Compare commits

..

No commits in common. "33e3bec3373ebe2ce43c0d1bd7d6770be3e17df8" and "303213da7374f741781f42e0f480d65434d42f31" have entirely different histories.

9 changed files with 11 additions and 74 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "ultrawidify", "name": "ultrawidify",
"version": "6.2.1", "version": "6.2.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "ultrawidify", "name": "ultrawidify",
"version": "6.2.1", "version": "6.2.0",
"description": "Aspect ratio fixer for youtube and other sites, with automatic aspect ratio detection. Supports ultrawide and other ratios.", "description": "Aspect ratio fixer for youtube and other sites, with automatic aspect ratio detection. Supports ultrawide and other ratios.",
"author": "Tamius Han <tamius.han@gmail.com>", "author": "Tamius Han <tamius.han@gmail.com>",
"scripts": { "scripts": {

View File

@ -24,7 +24,7 @@
@mouseleave="allowContextMenuHide()" @mouseleave="allowContextMenuHide()"
> >
<template v-slot:activator> <template v-slot:activator>
<div class="context-item uw-clickable uw-menu-trigger"> <div class="context-item uw-clickable">
Ultrawidify Ultrawidify
</div> </div>
</template> </template>
@ -300,6 +300,7 @@ export default {
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2); this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
} }
}, },
async created() { async created() {
this.logger = new Logger(); this.logger = new Logger();

View File

@ -8,7 +8,7 @@
</div> </div>
</div> </div>
<div v-if="siteSupportLevel === 'community'" class="site-support community"> <div v-if="siteSupportLevel === 'community'" class="site-support community">
<mdicon name="account-group" /> <mdicon name="handshake" />
<div v-if="!small">Community</div> <div v-if="!small">Community</div>
<div class="tooltip"> <div class="tooltip">
<template v-if="small">Community&nbsp;&nbsp;</template> <template v-if="small">Community&nbsp;&nbsp;</template>
@ -35,7 +35,7 @@
You have manually changed settings for this site. The extension is doing what you told it to do. You have manually changed settings for this site. The extension is doing what you told it to do.
</div> </div>
</div> </div>
<div v-if="siteSupportLevel === 'officially-disabled'" class="site-support officially-disabled"> <div v-if="siteSupportLevel === 'community'">
<mdicon class="site-support no-support" name="checkbox-marked-circle" /> <mdicon class="site-support no-support" name="checkbox-marked-circle" />
<div v-if="!small">Not supported</div> <div v-if="!small">Not supported</div>
<div class="tooltip"> <div class="tooltip">
@ -113,17 +113,8 @@ export default {
} }
} }
&.officially-disabled {
background-color: rgb(132, 24, 40);
color: #eee;
.mdi {
fill: #eee !important;
}
}
&.no-support { &.no-support {
background-color: rgb(83, 76, 77); background-color: rgb(132, 24, 40);
color: #eee; color: #eee;
.mdi { .mdi {

View File

@ -72,7 +72,6 @@ export default {
let isClickable = false; let isClickable = false;
let isOverTriggerZone = false; let isOverTriggerZone = false;
let isOverUIArea = false; let isOverUIArea = false;
let isOverMenuTrigger = false;
const elements = document.elementsFromPoint(eventData.coords.x, eventData.coords.y); const elements = document.elementsFromPoint(eventData.coords.x, eventData.coords.y);
for (const element of elements) { for (const element of elements) {
@ -85,9 +84,6 @@ export default {
if (element.classList?.contains('uw-ui-area')) { if (element.classList?.contains('uw-ui-area')) {
isOverUIArea = true; isOverUIArea = true;
} }
if (element.classList?.contains('uw-menu-trigger')) {
isOverMenuTrigger = true;
}
} }
this.triggerZoneActive = isOverTriggerZone; this.triggerZoneActive = isOverTriggerZone;
@ -116,12 +112,6 @@ export default {
{ {
action: 'uwui-clickable', action: 'uwui-clickable',
clickable: isClickable, clickable: isClickable,
hoverStats: {
isOverTriggerZone,
isOverMenuTrigger,
isOverUIArea,
hasMouse: !!document.querySelector(':hover'),
},
ts: +new Date() ts: +new Date()
}, },
origin origin

View File

@ -187,7 +187,7 @@ const ExtensionConfPatch = [
userOptions.newFeatureTracker['uw6.ui-popup'] = {show: 10}; userOptions.newFeatureTracker['uw6.ui-popup'] = {show: 10};
} }
}, { }, {
forVersion: '6.2.1', forVersion: '6.1.9',
updateFn: (userOptions: SettingsInterface, defaultOptions) => { updateFn: (userOptions: SettingsInterface, defaultOptions) => {
userOptions.ui = defaultOptions.ui; userOptions.ui = defaultOptions.ui;
userOptions.arDetect = defaultOptions.arDetect; userOptions.arDetect = defaultOptions.arDetect;

View File

@ -19,8 +19,6 @@ const csuiVersions = {
// 'dark': 'csui-dark' // csui-overlay-dark.html, maps to csui-dark.html // 'dark': 'csui-dark' // csui-overlay-dark.html, maps to csui-dark.html
}; };
const MAX_IFRAME_ERROR_COUNT = 5;
class UI { class UI {
constructor( constructor(
interfaceId, interfaceId,
@ -45,8 +43,6 @@ class UI {
this.playerData = uiConfig.playerData; this.playerData = uiConfig.playerData;
this.uiSettings = uiConfig.uiSettings; this.uiSettings = uiConfig.uiSettings;
this.iframeErrorCount = 0;
this.iframeConfirmed = false;
} }
async init() { async init() {
@ -284,43 +280,7 @@ class UI {
return; return;
} }
this.lastProbeResponseTs = event.data.ts; this.lastProbeResponseTs = event.data.ts;
// If iframe returns 'yes, we are clickable' and iframe is currently set to pointerEvents=auto,
// but hasMouse is false, then UI is attached to the wrong element. This probably means our
// detected player element is wrong. We need to perform this check if we aren't in global UI
/**
* action: 'uwui-clickable',
* clickable: isClickable,
* hoverStats: {
* isOverTriggerZone,
* isOverMenuTrigger,
* isOverUIArea,
* hasMouse: !!document.querySelector(':hover'),
* },
* ts: +new Date()
*/
if (!this.global) {
if (
this.uiIframe.style.pointerEvents === 'auto'
) {
if (
event.data.hoverStats.isOverTriggerZone
&& !event.data.hoverStats.hasMouse
) {
if (!this.iframeConfirmed) {
if (this.iframeErrorCount++ > MAX_IFRAME_ERROR_COUNT) {
// this.
}
}
} else {
this.iframeConfirmed = true;
}
}
}
this.uiIframe.style.pointerEvents = event.data.clickable ? 'auto' : 'none'; this.uiIframe.style.pointerEvents = event.data.clickable ? 'auto' : 'none';
this.uiIframe.style.display = event.data.opacity ? '100' : '0';
break; break;
case 'uw-bus-tunnel': case 'uw-bus-tunnel':
const busCommand = event.data.payload; const busCommand = event.data.payload;

View File

@ -280,13 +280,8 @@ class Resizer {
return; return;
} }
// If no aspect ratio is applied AND if no stretch mode is active, if ([AspectRatioType.Reset, AspectRatioType.Initial].includes(ar.type)) {
// we disable our CSS in order to prevent breaking websites by default, // console.log('run level is UI only because aspect ratio type is', ar.type)
// without any human interaction
if (
[AspectRatioType.Reset, AspectRatioType.Initial].includes(ar.type) &&
[StretchType.NoStretch, StretchType.Default].includes(this.stretcher.mode)
) {
this.eventBus.send('set-run-level', RunLevel.UIOnly); this.eventBus.send('set-run-level', RunLevel.UIOnly);
} else { } else {
this.eventBus.send('set-run-level', RunLevel.CustomCSSActive); this.eventBus.send('set-run-level', RunLevel.CustomCSSActive);

View File

@ -2,7 +2,7 @@
"manifest_version": 3, "manifest_version": 3,
"name": "Ultrawidify", "name": "Ultrawidify",
"description": "Removes black bars on ultrawide videos and offers advanced options to fix aspect ratio.", "description": "Removes black bars on ultrawide videos and offers advanced options to fix aspect ratio.",
"version": "6.2.1", "version": "6.2.0",
"icons": { "icons": {
"32":"res/icons/uw-32.png", "32":"res/icons/uw-32.png",
"64":"res/icons/uw-64.png" "64":"res/icons/uw-64.png"