Compare commits
No commits in common. "d94be7aa5e7731c16a424c09caaedca1fd167c39" and "f728cbf817ed44233f7b23c2d8d39aca4796dfa1" have entirely different histories.
d94be7aa5e
...
f728cbf817
42
CHANGELOG.md
42
CHANGELOG.md
@ -1,38 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
|
||||
### Plans for the future
|
||||
|
||||
* Native builds for Chromium Edge
|
||||
* Settings page looks ugly af right now. Maybe fix it some time later
|
||||
* other bug fixes
|
||||
|
||||
## v7.0 (planned major)
|
||||
* WebGL autodetection
|
||||
|
||||
## v6.0 (current major)
|
||||
|
||||
### v6.2.4
|
||||
* [#264](https://github.com/tamius-han/ultrawidify/issues/264) — fixed issue with white screen that affected some youtube users. Special thanks to [SnowyOwlNugget](https://github.com/SnowyOwlNugget">SnowyOwlNugget), who instead of whining provided the necessary information.
|
||||
* Minor updates to the settings
|
||||
* Switching between full screen, theater, and normal player now correctly enables and disables the extension according to the settings.
|
||||
* Don't reset settings if updating conf patches fails.
|
||||
* Darken in-player UI backgrounds until Chrome fixes its backdrop-filter bug
|
||||
|
||||
### v6.2.3
|
||||
* Fixed default persistent mode
|
||||
|
||||
### v6.2.2
|
||||
* Fixed the issue where stretching was not applied if no cropping was used
|
||||
* Added way to manually enable or disable color scheme detection, as a compromise between #259 and #264
|
||||
|
||||
### v6.2.1
|
||||
|
||||
* Fixed offset issue on Netflix
|
||||
* Fixed issue with overlay iframe not being transparent on twitter
|
||||
|
||||
### v6.2.0
|
||||
|
||||
* Parts of automatic aspect ratio detection use WebGL now. This should result in improved performance.
|
||||
* In-player UI now indicates whether a site is having a problem with automatic aspect ratio detection.
|
||||
* UI improvements
|
||||
|
||||
Since automatic aspect ratio detection had to be rewritten completely and since the new version needs to be out 5 days ago, there are some regressions in the automatic aspect ratio detection.
|
||||
|
||||
### v6.1.0
|
||||
|
||||
Was skipped due to how major the changes were.
|
||||
|
||||
### v6.0.1
|
||||
|
||||
* Fixed external links
|
||||
|
@ -6,12 +6,6 @@ import ExtensionMode from '../enums/ExtensionMode.enum'
|
||||
import StretchType from '../enums/StretchType.enum'
|
||||
import VideoAlignmentType from '../enums/VideoAlignmentType.enum'
|
||||
|
||||
export enum ExtensionEnvironment {
|
||||
Normal = 'normal',
|
||||
Theater = 'theater',
|
||||
Fullscreen = 'fullscreen',
|
||||
}
|
||||
|
||||
export interface KeyboardShortcutInterface {
|
||||
key?: string,
|
||||
code?: string,
|
||||
|
@ -24,7 +24,20 @@
|
||||
@mouseleave="allowContextMenuHide()"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<div class="context-item uw-clickable uw-menu-trigger relative">
|
||||
<div v-if="hoverStats.isOverTriggerMenu && !hoverStats.hasMouse" class="absolute ui-warning">
|
||||
<b>Video player is not being detected correctly</b><br/>
|
||||
<p>
|
||||
That's why this menu doesn't work correctly.
|
||||
</p>
|
||||
<p>
|
||||
It may start working if you move your mouse over the button a few times. If it doesn't, open the UI from the extension popup.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Ultrawidify
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<slot>
|
||||
<!--
|
||||
@ -703,10 +716,8 @@ export default {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
font-size: 0.9rem;
|
||||
|
||||
// width: 112.25%;
|
||||
// transform: translate(-12.5%, 12.5%) scale(0.75);
|
||||
width: 112.25%;
|
||||
transform: translate(-12.5%, 12.5%) scale(0.75);
|
||||
|
||||
> * {
|
||||
margin-top: 0.5rem;
|
||||
|
@ -18,19 +18,6 @@ body {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.main-window::before {
|
||||
content: ' backdrop-filter machine broke :( googlo pls fix';
|
||||
color: #000;
|
||||
position: absolute;
|
||||
left: -0.5rem;
|
||||
top: -0.5rem;
|
||||
z-index: -1;
|
||||
width: calc(100% + 1rem);
|
||||
height: calc(100% + 1rem);
|
||||
background-image: url('/csui/res/img/uw-window-bg-texture-3.webp');
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
/* STANDARD WIDTHS AND HEIGHTS */
|
||||
.w100 {
|
||||
width: 100%;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
class="popup-panel flex flex-col uw-clickable h-full main-window relative"
|
||||
class="popup-panel flex flex-col uw-clickable h-full"
|
||||
>
|
||||
<div class="popup-window-header">
|
||||
<div class="header-title">
|
||||
@ -248,8 +248,6 @@ export default {
|
||||
// height: 100%;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
.tab-row {
|
||||
width: 22rem;
|
||||
flex-grow: 0;
|
||||
|
@ -3,27 +3,94 @@
|
||||
<div class="flex flex-row gap-2 bg-black">
|
||||
<div class="w-[1/2]" style="width: 50%">
|
||||
<h1>What's new</h1>
|
||||
<!-- <p>Full changelog for older versions <a href="https://github.com/tamius-han/ultrawidify/blob/master/CHANGELOG.md" target="_blank">is available here</a>.</p> -->
|
||||
|
||||
<h2>6.2.4</h2>
|
||||
<ul>
|
||||
<li>[<a href="https://github.com/tamius-han/ultrawidify/issues/264" target="_blank">#264</a>] Fixed issue with white screen that affected <i>some</i> youtube users.<br/><br/>Special thanks to <a href="https://github.com/SnowyOwlNugget">SnowyOwlNugget</a>, who instead of whining provided the necessary information.</li>
|
||||
<li>Minor updates to the settings</li>
|
||||
<li>Switching between full screen, theater, and normal player now correctly enables and disables the extension according to the settings.</li>
|
||||
<li>Does anyone even read these?</li>
|
||||
<li>By default, extension is now only enabled for sites with 'official' and 'community' support for new installs. Extension will need to be manually enabled for other sites.</li>
|
||||
<li>Gussief1, you owe me 5 bucks. Time to put your money where your mouth is. Paypal is <a class="donate" href="https://www.paypal.com/paypalme/tamius" target="_blank">here.</a></li>
|
||||
<li>Added background to in-player UI due to chrome bug affecting <code>backdrop-filter</code> inside transparent iframes.</li>
|
||||
</ul>
|
||||
<p>Full changelog for older versions <a href="https://github.com/tamius-han/ultrawidify/blob/master/CHANGELOG.md" target="_blank">is available here</a>.</p>
|
||||
|
||||
<h2>6.2.0</h2>
|
||||
<p>
|
||||
Planned future updates <i>before</i> Tam vanishes due to convention season obligations:
|
||||
There's been another major change that skips a version.
|
||||
</p>
|
||||
<ul>
|
||||
<li>Re-implement manual zoom</li>
|
||||
<li>It appears that ExtConfPatch for version 6.0.0 keeps getting re-applied due to a bug, but my RAID ran out for this release.</li>
|
||||
<li>Parts of automatic aspect ratio detection use WebGL now. This should result in improved performance. Slightly underwhelming blog post about this issue can be found <a href="https://stuff.tamius.net/sacred-texts/2024/10/02/hot-dang-i-shouldnt-have-given-on-webgl/" target="_blank">here</a>.</li>
|
||||
<li>In-player UI now indicates whether a site is having a problem with automatic aspect ratio detection.</li>
|
||||
<li>UI improvements</li>
|
||||
</ul>
|
||||
<p>
|
||||
Since automatic aspect ratio detection had to be rewritten completely and since the new version needs to be out 5 days ago, there are some regressions in the automatic aspect ratio detection.
|
||||
</p>
|
||||
|
||||
Minor revisions:
|
||||
|
||||
<h3>6.2.1</h3>
|
||||
<ul>
|
||||
<li>Fixed offset issue on Netflix</li>
|
||||
<li>Fixed issue with overlay iframe not being transparent on twitter</li>
|
||||
</ul>
|
||||
|
||||
<h3>6.2.2</h3>
|
||||
<ul>
|
||||
<li>Fixed the issue where stretching was not applied if no cropping was used</li>
|
||||
<li>Half-fixed in-player UI on sites where player is not detected correctly</li>
|
||||
</ul>
|
||||
|
||||
<h3>6.2.3</h3>
|
||||
<ul>
|
||||
<li>Fixed default persistent mode</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h2>6.0.0</h2>
|
||||
<p>
|
||||
I don't think I need to write a changelog for this one. I've also been working on this, on and (mostly) off, for ... a long time, so I might have "kinda forgot" some minor things.
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>Manifest v3</b>. Bit late, but still.</li>
|
||||
<li>
|
||||
<b>In-player UI.</b><br/>
|
||||
This one took major effort to pull off. Required some changes under the hood, required me to de-spaghettify some code. The UI will only show
|
||||
if the video takes up sufficient amount of space (currently determined as 960 pixels wide).
|
||||
</li>
|
||||
<li>
|
||||
<b>New alignment options.</b> Video can be aligned vertically as well as horizontally.
|
||||
</li>
|
||||
<!-- <li>
|
||||
By default, Ultrawidify will not kick in on "small videos". You have to be either in full screen or theater mode. Ultrawidify assumes that any
|
||||
video that takes up more than 85% of the window width is being viewed in theater mode. This value may be tweaked later on. This feature can be
|
||||
configured (or turned off entirely) via 'Advanced options' menu on the in-player UI.
|
||||
</li> -->
|
||||
<li>
|
||||
The in-player extension UI will do a better job differentiating between the various level of support: "official" for the sites that Tam can check
|
||||
on his own, "fingers crossed" for sites that Tam can't check because my load-bearing credit card can't support the weight of a dozen subscription
|
||||
services, and "community support" for sites that enjoy support through the helping hand of people willing to help.
|
||||
</li>
|
||||
<li>
|
||||
The in-player UI should now display a warning whenever Ultrawidify detects automatic aspect ratio detection isn't happening because the site uses DRM.
|
||||
</li>
|
||||
<!-- <li>
|
||||
Better zooming. The slider is back, baby.
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
Panning option that's a bit more intuitive.
|
||||
</li> -->
|
||||
</ul>
|
||||
<h3>Regressions</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Due to major changes under the hood, custom settings from older versions were NOT been migrated (probably).
|
||||
</li>
|
||||
<li>
|
||||
It is unclear how extension acts on sites with more than one video.
|
||||
</li>
|
||||
<li>
|
||||
Extension lost the ability to discriminate between iframes. Actions taken through the popup will be affect <b>all</b> iframes.
|
||||
</li>
|
||||
<li>
|
||||
Hope the UI is worth the regressions, because getting UI to work has been a MAJOR pain in the ass.
|
||||
</li>
|
||||
</ul>
|
||||
<p>Minor revisions:</p>
|
||||
<h2>6.0.1</h2>
|
||||
<p>Fixed external links.</p>
|
||||
</div>
|
||||
<div class="w-[1/2]" style="width: 50%; padding-left: 1rem; padding-top: 5rem;">
|
||||
<h2>Thank you monies</h2>
|
||||
@ -33,6 +100,7 @@
|
||||
<p class="text-center">
|
||||
<a class="donate" href="https://www.paypal.com/paypalme/tamius" target="_blank">Donate on Paypal</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<!-- The rest of the menu is disabled when extension is disabled -->
|
||||
<div :class="{disabled: simpleEffectiveSettings.enable === 'disabled'}">
|
||||
<div :class="{disabled: simpleExtensionSettings.enable === 'disabled' }">
|
||||
<!-- Enable AARD -->
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
@ -275,7 +275,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
CropModePersistence: CropModePersistence,
|
||||
ExtensionMode,
|
||||
alignmentOptions: [
|
||||
{label: 'Top left', arguments: {x: VideoAlignmentType.Left, y: VideoAlignmentType.Top}},
|
||||
{label: 'Top center', arguments: {x: VideoAlignmentType.Center, y: VideoAlignmentType.Top}},
|
||||
@ -309,14 +308,6 @@ export default {
|
||||
enableUI: this.compileSimpleSettings('enableUI')
|
||||
}
|
||||
},
|
||||
simpleEffectiveSettings() {
|
||||
return {
|
||||
enable: this.compileSimpleSettings('enable', 'site-effective'),
|
||||
enableAard: this.compileSimpleSettings('enableAard', 'site-effective'),
|
||||
enableKeyboard: this.compileSimpleSettings('enableKeyboard', 'site-effective'),
|
||||
enableUI: this.compileSimpleSettings('enableUI', 'site-effective')
|
||||
}
|
||||
},
|
||||
simpleDefaultSettings() {
|
||||
return {
|
||||
enable: this.getDefaultOptionLabel('enable'),
|
||||
@ -356,20 +347,8 @@ export default {
|
||||
/**
|
||||
* Compiles our extension settings into more user-friendly options
|
||||
*/
|
||||
compileSimpleSettings(component, getFor = 'site') {
|
||||
let settingsData;
|
||||
switch (getFor) {
|
||||
case 'site':
|
||||
settingsData = this.siteSettings?.raw;
|
||||
break;
|
||||
case 'site-effective':
|
||||
settingsData = this.siteSettings?.data;
|
||||
break;
|
||||
case 'default':
|
||||
settingsData = this.settings.active.sites['@global'];
|
||||
break;
|
||||
}
|
||||
|
||||
compileSimpleSettings(component, getDefaults) {
|
||||
const settingsData = getDefaults ? this.settings.active.sites['@global'] : this.siteSettings?.raw;
|
||||
try {
|
||||
if (
|
||||
( settingsData?.[component]?.normal === ExtensionMode.Disabled || component === 'enableUI')
|
||||
@ -414,7 +393,7 @@ export default {
|
||||
},
|
||||
|
||||
getDefaultOptionLabel(component) {
|
||||
const componentValue = this.compileSimpleSettings(component, 'default');
|
||||
const componentValue = this.compileSimpleSettings(component, true);
|
||||
|
||||
if (componentValue === 'loading') {
|
||||
return componentValue;
|
||||
@ -523,18 +502,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (component === 'enable') {
|
||||
this.setExtensionMode('enableAard', event);
|
||||
this.setExtensionMode('enableKeyboard', event);
|
||||
|
||||
// in enableUI, 'enabled' is unused and 'theater' uses its place
|
||||
if (option === 'enabled') {
|
||||
this.setExtensionMode('enableUI', {target: {value: 'theater'}});
|
||||
} else {
|
||||
this.setExtensionMode('enableUI', event);
|
||||
}
|
||||
}
|
||||
|
||||
if (option === 'default') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Default,
|
||||
|
@ -76,7 +76,6 @@ export default {
|
||||
left: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.activator {
|
||||
position: relative;
|
||||
@ -84,12 +83,12 @@ export default {
|
||||
|
||||
font-size: .95rem;
|
||||
padding: 1rem 1.6rem;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
backdrop-filter: blur(16px) saturate(120%);
|
||||
|
||||
white-space: nowrap;
|
||||
&:hover {
|
||||
background-color: rgba(255, 128, 64, 0.95);
|
||||
background-color: rgba(255, 128, 64, 0.5);
|
||||
}
|
||||
|
||||
&.expand-left {
|
||||
|
@ -24,17 +24,16 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.item {
|
||||
position: relative;
|
||||
font-size: .95rem;
|
||||
font-family: 'Overpass';
|
||||
padding: 1rem 1.6rem;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
backdrop-filter: blur(16px) saturate(120%);
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
&.can-hover:hover {
|
||||
background-color: rgba(0,0,0,0.98);
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
border-bottom: 1px solid #fa6;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
playerDimensionsUpdate(dimensions) {
|
||||
if (!dimensions?.width || !dimensions?.height) {
|
||||
if (!dimensions.width || !dimensions.height) {
|
||||
this.playerDimensions = undefined;
|
||||
}
|
||||
if (dimensions?.width !== this.playerDimensions?.width || dimensions?.height !== this.playerDimensions?.height) {
|
||||
|
@ -1419,24 +1419,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
// #g — only available in @global
|
||||
// #s — only available for specific site
|
||||
enable: { // How should extension work:
|
||||
fullscreen: ExtensionMode.Disabled, // 'enabled' - work everywhere except blacklist
|
||||
theater: ExtensionMode.Disabled, //
|
||||
fullscreen: ExtensionMode.Disabled, // 'enabled' - work everywhere except blacklist
|
||||
theater: ExtensionMode.Disabled, // 'whitelist' - only work on whitelisted sites (#g)
|
||||
normal: ExtensionMode.Disabled, // 'disabled' - work nowhere
|
||||
}, // 'default' - follow global rules (#s)
|
||||
enableAard: { // Should we try to automatically detect aspect ratio?
|
||||
fullscreen: ExtensionMode.Disabled, // Options: 'enabled', 'default' (#s), 'disabled'
|
||||
theater: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Enabled, // Options: 'enabled', 'whitelist' (#g), 'default' (#s), 'disabled'
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Disabled, // Lies! means 'theater-ish'
|
||||
normal: ExtensionMode.Disabled // Not actually used.
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled, // Lies! means 'theater-ish'
|
||||
normal: ExtensionMode.Enabled // Not actually used.
|
||||
},
|
||||
|
||||
defaultType: 'unknown',
|
||||
@ -1481,24 +1481,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"www.youtube.com" : {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
|
||||
override: false, // ignore value localStorage in favour of this
|
||||
@ -1521,24 +1521,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"www.netflix.com" : {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Disabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Disabled
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
|
||||
override: false,
|
||||
@ -1547,23 +1547,23 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"www.disneyplus.com" : {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: 'community',
|
||||
@ -1593,23 +1593,60 @@ const ExtensionConf: SettingsInterface = {
|
||||
normal: ExtensionMode.Enabled,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: 'official',
|
||||
defaultType: 'official',
|
||||
},
|
||||
"vimeo.com": {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: 'official',
|
||||
defaultType: 'official',
|
||||
activeDOMConfig: 'official',
|
||||
DOMConfig: {
|
||||
'official': {
|
||||
type: 'official',
|
||||
// customCss: ".player_outro_area {\n width: 100% !important;\n display: flex !important;\n justify-content: center !important;\n}\n\n.player_container, .player {\n width: 100% !important; \n}",
|
||||
elements: {
|
||||
player: {
|
||||
manual: true,
|
||||
querySelectors: ".player_outro_area",
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"old.reddit.com" : {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Disabled,
|
||||
@ -1758,24 +1795,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"www.wakanim.tv": {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Enabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: 'community',
|
||||
defaultType: 'community',
|
||||
@ -1794,24 +1831,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"app.plex.tv": {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: 'community',
|
||||
defaultType: 'community',
|
||||
@ -1825,24 +1862,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"metaivi.com": {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: "community",
|
||||
defaultType: "community",
|
||||
@ -1860,24 +1897,24 @@ const ExtensionConf: SettingsInterface = {
|
||||
},
|
||||
"piped.kavin.rocks": {
|
||||
enable: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableAard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default,
|
||||
},
|
||||
enableKeyboard: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
enableUI: {
|
||||
fullscreen: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
normal: ExtensionMode.Disabled
|
||||
fullscreen: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
normal: ExtensionMode.Default
|
||||
},
|
||||
type: "community",
|
||||
defaultType: "community",
|
||||
|
@ -177,32 +177,38 @@ class Settings {
|
||||
}
|
||||
private applySettingsPatches(oldVersion, patches) {
|
||||
let index = this.findFirstNecessaryPatch(oldVersion, patches);
|
||||
|
||||
if (index === -1) {
|
||||
this.logger?.log('info','settings','[Settings::applySettingsPatches] There are no pending conf patches.');
|
||||
return;
|
||||
}
|
||||
|
||||
// apply all remaining patches
|
||||
this.logger?.log('info', 'settings', `[Settings::applySettingsPatches] There are ${patches.length - index} settings patches to apply`);
|
||||
while (index < patches.length) {
|
||||
const updateFn = patches[index].updateFn;
|
||||
delete patches[index].forVersion;
|
||||
delete patches[index].updateFn;
|
||||
try {
|
||||
this.logger?.log('info', 'settings', `[Settings::applySettingsPatches] There are ${patches.length - index} settings patches to apply`);
|
||||
while (index < patches.length) {
|
||||
const updateFn = patches[index].updateFn;
|
||||
delete patches[index].forVersion;
|
||||
delete patches[index].updateFn;
|
||||
|
||||
if (Object.keys(patches[index]).length > 0) {
|
||||
ObjectCopy.overwrite(this.active, patches[index]);
|
||||
}
|
||||
if (updateFn) {
|
||||
|
||||
try {
|
||||
updateFn(this.active, this.getDefaultSettings());
|
||||
} catch (e) {
|
||||
this.logger?.log('error', 'settings', '[Settings::applySettingsPatches] Failed to execute update function. Keeping settings object as-is. Error:', e);
|
||||
if (Object.keys(patches[index]).length > 0) {
|
||||
ObjectCopy.overwrite(this.active, patches[index]);
|
||||
}
|
||||
}
|
||||
if (updateFn) {
|
||||
|
||||
index++;
|
||||
try {
|
||||
updateFn(this.active, this.getDefaultSettings());
|
||||
} catch (e) {
|
||||
this.logger?.log('error', 'settings', '[Settings::applySettingsPatches] Failed to execute update function. Keeping settings object as-is. Error:', e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to upgrade settings.', e);
|
||||
this.setActive(this.getDefaultSettings());
|
||||
this.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
|
||||
import ExtensionMode from '../../../common/enums/ExtensionMode.enum';
|
||||
import { ExtensionEnvironment } from '../../../common/interfaces/SettingsInterface';
|
||||
import EventBus from '../EventBus';
|
||||
import Logger from '../Logger';
|
||||
import Settings from '../Settings';
|
||||
import { SiteSettings } from '../settings/SiteSettings';
|
||||
import VideoData from '../video-data/VideoData';
|
||||
import { Corner } from './enums/corner.enum';
|
||||
import { VideoPlaybackState } from './enums/video-playback-state.enum';
|
||||
@ -221,17 +218,10 @@ export class Aard {
|
||||
private logger: Logger;
|
||||
private videoData: VideoData;
|
||||
private settings: Settings;
|
||||
private siteSettings: SiteSettings;
|
||||
private eventBus: EventBus;
|
||||
private arid: string;
|
||||
|
||||
private eventBusCommands = {
|
||||
'uw-environment-change': {
|
||||
function: (newEnvironment: ExtensionEnvironment) => {
|
||||
console.log('received extension environment:', newEnvironment, 'player env:', this.videoData?.player?.environment);
|
||||
this.startCheck();
|
||||
}
|
||||
}
|
||||
// 'get-aard-timing': {
|
||||
// function: () => this.handlePerformanceDataRequest()
|
||||
// }
|
||||
@ -277,7 +267,6 @@ export class Aard {
|
||||
this.videoData = videoData;
|
||||
this.video = videoData.video;
|
||||
this.settings = videoData.settings;
|
||||
this.siteSettings = videoData.siteSettings;
|
||||
this.eventBus = videoData.eventBus;
|
||||
|
||||
this.eventBus.subscribeMulti(this.eventBusCommands, this);
|
||||
@ -295,6 +284,7 @@ export class Aard {
|
||||
* This method should only ever be called from constructor.
|
||||
*/
|
||||
private init() {
|
||||
|
||||
this.canvasStore = {
|
||||
main: this.createCanvas('main-gl')
|
||||
};
|
||||
@ -311,7 +301,7 @@ export class Aard {
|
||||
),
|
||||
};
|
||||
|
||||
this.startCheck();
|
||||
this.start();
|
||||
}
|
||||
|
||||
private createCanvas(canvasId: string, canvasType?: 'webgl' | 'fallback') {
|
||||
@ -351,20 +341,6 @@ export class Aard {
|
||||
}
|
||||
//#endregion
|
||||
|
||||
/**
|
||||
* Checks whether autodetection can run
|
||||
*/
|
||||
startCheck() {
|
||||
if (!this.videoData.player) {
|
||||
console.warn('Player not detected!')
|
||||
}
|
||||
if (this.siteSettings.data.enableAard[this.videoData.player.environment] === ExtensionMode.Enabled) {
|
||||
this.start();
|
||||
} else {
|
||||
this.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts autodetection loop.
|
||||
*/
|
||||
|
@ -13,7 +13,6 @@ import UI from '../uwui/UI';
|
||||
import { SiteSettings } from '../settings/SiteSettings';
|
||||
import PageInfo from './PageInfo';
|
||||
import { RunLevel } from '../../enum/run-level.enum';
|
||||
import { ExtensionEnvironment } from '../../../common/interfaces/SettingsInterface';
|
||||
|
||||
if (process.env.CHANNEL !== 'stable'){
|
||||
console.info("Loading: PlayerData.js");
|
||||
@ -139,7 +138,6 @@ class PlayerData {
|
||||
private dimensionChangeListener = {
|
||||
that: this,
|
||||
handleEvent: function(event: Event) {
|
||||
this.that.trackEnvironmentChanges(event);
|
||||
this.that.trackDimensionChanges()
|
||||
}
|
||||
}
|
||||
@ -154,7 +152,6 @@ class PlayerData {
|
||||
}
|
||||
if (!this.dimensions) {
|
||||
this.trackDimensionChanges();
|
||||
this.trackEnvironmentChanges();
|
||||
}
|
||||
|
||||
return this.dimensions.width / this.dimensions.height;
|
||||
@ -164,21 +161,6 @@ class PlayerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets current environment (needed when determining whether extension runs in fulls screen, theater, or normal)
|
||||
*/
|
||||
private lastEnvironment: ExtensionEnvironment;
|
||||
|
||||
get environment(): ExtensionEnvironment {
|
||||
if (this.isFullscreen) {
|
||||
return ExtensionEnvironment.Fullscreen;
|
||||
}
|
||||
if (this.isTheaterMode) {
|
||||
return ExtensionEnvironment.Theater;
|
||||
}
|
||||
return ExtensionEnvironment.Normal;
|
||||
}
|
||||
|
||||
//#region lifecycle
|
||||
constructor(videoData) {
|
||||
try {
|
||||
@ -216,7 +198,6 @@ class PlayerData {
|
||||
}
|
||||
|
||||
this.trackDimensionChanges();
|
||||
this.trackEnvironmentChanges();
|
||||
this.startChangeDetection();
|
||||
|
||||
document.addEventListener('fullscreenchange', this.dimensionChangeListener);
|
||||
@ -356,13 +337,6 @@ class PlayerData {
|
||||
return newTheaterMode;
|
||||
}
|
||||
|
||||
trackEnvironmentChanges() {
|
||||
if (this.environment !== this.lastEnvironment) {
|
||||
this.lastEnvironment = this.environment;
|
||||
this.eventBus.send('uw-environment-change', {newEnvironment: this.environment});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -465,7 +439,6 @@ class PlayerData {
|
||||
|
||||
onPlayerDimensionsChanged(mutationList?, observer?) {
|
||||
this.trackDimensionChanges();
|
||||
this.trackEnvironmentChanges();
|
||||
}
|
||||
|
||||
|
||||
@ -657,7 +630,6 @@ class PlayerData {
|
||||
|
||||
this.element = elementStack[nextIndex].element;
|
||||
this.trackDimensionChanges();
|
||||
this.trackEnvironmentChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@ -862,9 +834,7 @@ class PlayerData {
|
||||
this.ui = undefined;
|
||||
this.element = this.getPlayer();
|
||||
// this.notificationService?.replace(this.element);
|
||||
|
||||
this.trackDimensionChanges();
|
||||
this.trackEnvironmentChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,6 @@ import { ExtensionStatus } from './ExtensionStatus';
|
||||
import { RunLevel } from '../../enum/run-level.enum';
|
||||
import { Aard } from '../aard/Aard';
|
||||
import { Stretch } from '../../../common/interfaces/StretchInterface';
|
||||
import ExtensionMode from '../../../common/enums/ExtensionMode.enum';
|
||||
import { ExtensionEnvironment } from '../../../common/interfaces/SettingsInterface';
|
||||
|
||||
/**
|
||||
* VideoData — handles CSS for the video element.
|
||||
@ -78,8 +76,6 @@ class VideoData {
|
||||
|
||||
eventBus: EventBus;
|
||||
extensionStatus: ExtensionStatus;
|
||||
|
||||
private currentEnvironment: ExtensionEnvironment;
|
||||
//#endregion
|
||||
|
||||
|
||||
@ -101,11 +97,6 @@ class VideoData {
|
||||
},
|
||||
'set-run-level': {
|
||||
function: (runLevel: RunLevel) => this.setRunLevel(runLevel)
|
||||
},
|
||||
'uw-environment-change': {
|
||||
function: () => {
|
||||
this.onEnvironmentChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +191,7 @@ class VideoData {
|
||||
if (!this.mutationObserver) {
|
||||
this.setupMutationObserver();
|
||||
}
|
||||
// this.eventBus.send('inject-css', this.baseVideoCss);
|
||||
this.eventBus.send('inject-css', this.baseVideoCss);
|
||||
} catch (e) {
|
||||
console.error('Failed to inject base css!', e);
|
||||
}
|
||||
@ -398,26 +389,8 @@ class VideoData {
|
||||
}
|
||||
//#endregion
|
||||
|
||||
onEnvironmentChanged() {
|
||||
if (!this.player) {
|
||||
return;
|
||||
}
|
||||
if (this.currentEnvironment !== this.player.environment) {
|
||||
console.warn('environment changed to:', this.player.environment);
|
||||
this.currentEnvironment = this.player.environment;
|
||||
if (this.siteSettings.data.enable[this.player.environment] === ExtensionMode.Disabled) {
|
||||
this.setRunLevel(RunLevel.Off);
|
||||
} else {
|
||||
this.restoreAr();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setRunLevel(runLevel: RunLevel, options?: {fromPlayer?: boolean}) {
|
||||
if (this.player && this.siteSettings.data.enable[this.player.environment] !== ExtensionMode.Enabled) {
|
||||
runLevel = RunLevel.Off;
|
||||
}
|
||||
|
||||
if (this.runLevel === runLevel) {
|
||||
return; // also no need to propagate to the player
|
||||
}
|
||||
@ -580,8 +553,6 @@ class VideoData {
|
||||
// the 'style' attributes don't necessarily trigger. This means we also need to trigger
|
||||
// restoreAr here, in case video size was changed this way
|
||||
this.player.forceRefreshPlayerElement();
|
||||
this.eventBus.send('uw-environment-change', {newEnvironment: this.player.environment});
|
||||
|
||||
this.restoreAr();
|
||||
|
||||
// sometimes something fucky wucky happens and mutations aren't detected correctly, so we
|
||||
@ -600,7 +571,7 @@ class VideoData {
|
||||
this._processDimensionsChanged,
|
||||
250,
|
||||
{
|
||||
// leading: true,
|
||||
leading: true,
|
||||
trailing: true
|
||||
}
|
||||
);
|
||||
@ -723,7 +694,7 @@ class VideoData {
|
||||
if (!this.aard) {
|
||||
this.initArDetection();
|
||||
}
|
||||
this.aard.startCheck();
|
||||
this.aard.start();
|
||||
} catch (e) {
|
||||
this.logger.log('warn', 'debug', '[VideoData::startArDetection()] Could not start aard for some reason. Was the function was called too early?', e);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ class Resizer {
|
||||
|
||||
// handle autodetection stuff
|
||||
if (ar.type === AspectRatioType.Automatic) {
|
||||
this.videoData.aard?.startCheck();
|
||||
this.videoData.aard?.start();
|
||||
return;
|
||||
} else if (ar.type !== AspectRatioType.AutomaticUpdate) {
|
||||
this.videoData.aard?.stop();
|
||||
@ -429,7 +429,7 @@ class Resizer {
|
||||
}
|
||||
|
||||
applyScaling(stretchFactors: VideoDimensions, options?: {noAnnounce?: boolean, ar?: Ar}) {
|
||||
// this.stretcher.chromeBugMitigation(stretchFactors);
|
||||
this.stretcher.chromeBugMitigation(stretchFactors);
|
||||
|
||||
// let the UI know
|
||||
if(!options?.noAnnounce) {
|
||||
@ -533,10 +533,6 @@ class Resizer {
|
||||
this.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores aspect ratio to last known aspect ratio
|
||||
* @returns
|
||||
*/
|
||||
restore() {
|
||||
if (!this.manualZoom) {
|
||||
this.logger.log('info', 'debug', "[Resizer::restore] <rid:"+this.resizerId+"> attempting to restore aspect ratio", {'lastAr': this.lastAr} );
|
||||
|
Loading…
Reference in New Issue
Block a user