diff --git a/CHANGELOG.md b/CHANGELOG.md index e5af22b..703a5ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,10 +22,11 @@ * 'Site settings' tab should now work in Chrome as well ([#126](https://github.com/tamius-han/ultrawidify/issues/126)) * Popup interface now refreshes properly ([#127](https://github.com/tamius-han/ultrawidify/issues/127)) * Videos should now be scaled correctly when the display is narrower than video's native aspect ratio ([#118](https://github.com/tamius-han/ultrawidify/issues/118)) -* Edge users using CWS version of the extension get a very aggressive warning when trying to use the extension with Edge * Fullscreen videos on streamable are aligned correctly ([#116](https://github.com/tamius-han/ultrawidify/issues/118)). * **[4.5.1.1]** Streamable fix broke old.reddit + RES on embeds from v.redd.it and streamable.com. We're now using an alternative implementation. ([#128](https://github.com/tamius-han/ultrawidify/issues/128)) * **[4.5.1.2]** Fixed the issue where videos would sometimes get misaligned while using hybrid stretch. ([#125](https://github.com/tamius-han/ultrawidify/issues/125)) +* **[4.5.1.3]** Added fix for disney plus +* **[4.5.1.3]** Microsoft Edge has fixed the bugs that prevented the extension from working properly. Popup should no longer be shown. ### v4.5.0 (Current) diff --git a/package.json b/package.json index a46fe5a..22ca37d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "Tamius Han ", "scripts": { "build": "npm run pre-build; cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules", - "build-all": "mkdir -p ./build/old; npm run pre-build; rm ./dist-zip/uw-amo-source.zip; mv -f ./dist-zip/*.zip ./build/old; npm run build; node scripts/build-zip.js ff; npm run build-chrome; node scripts/build-zip.js chrome; ./scripts/prepare-amo-source.sh", + "build-all": "mkdir -p ./build/old; npm run pre-build; rm ./dist-zip/uw-amo-source.zip; mv -f ./dist-zip/*.zip ./build/old; npm run build; node scripts/build-zip.js ff; npm run build-chrome; node scripts/build-zip.js chrome; npm run build-edge; node scripts/build-zip.js edge; ./scripts/prepare-amo-source.sh", "build-chrome": "cross-env NODE_ENV=production BROWSER=chrome CHANNEL=stable webpack --hide-modules", "build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome webpack --hide-modules", "build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules", diff --git a/src/csui/PlayerUiComponent.vue b/src/csui/PlayerUiComponent.vue index 0d4e56c..9e8eb02 100644 --- a/src/csui/PlayerUiComponent.vue +++ b/src/csui/PlayerUiComponent.vue @@ -138,7 +138,7 @@ export default { }, methods: { getUrl(url) { - return BrowserDetect.firefox ? browser.runtime.getURL(url) : chrome.runtime.getURL(url); + return BrowserDetect.getURL(url); }, async hidePopupForever() { const settings = new Settings(); diff --git a/src/ext/conf/BrowserDetect.js b/src/ext/conf/BrowserDetect.js index d2d58e5..a552e7d 100644 --- a/src/ext/conf/BrowserDetect.js +++ b/src/ext/conf/BrowserDetect.js @@ -4,16 +4,28 @@ if (process.env.CHANNEL !== 'stable') { console.info('Loaded BrowserDetect'); } +function detectEdgeUA() { + return /Edg\/(\.?[0-9]*)*$/.test(window.navigator.userAgent); +} + +function getBrowserObj() { + return process.env.BROWSER === 'firefox' ? browser : chrome; +} + +function getURL(url) { + return process.env.BROWSER === 'firefox' ? browser.runtime.getURL(url) : chrome.runtime.getURL(url); +} const BrowserDetect = { firefox: process.env.BROWSER === 'firefox', + anyChromium: process.env.BROWSER !== 'firefox', chrome: process.env.BROWSER === 'chrome', edge: process.env.BROWSER === 'edge', processEnvBrowser: process.env.BROWSER, processEnvChannel: process.env.CHANNEL, - isEdgeUA: () => /Edg\/(\.?[0-9]*)*$/.test(window.navigator.userAgent), - getBrowserObj: () => { return process.env.BROWSER === 'firefox' ? browser : chrome; }, - getURL: (url) => { console.log('getting file:', url); console.log(process.env.BROWSER === 'firefox' ? browser.runtime.getURL(url) : chrome.runtime.getURL(url)); return process.env.BROWSER === 'firefox' ? browser.runtime.getURL(url) : chrome.runtime.getURL(url); }, + isEdgeUA: detectEdgeUA(), + browserObj: getBrowserObj(), + getURL: (url) => getURL(url), } if (process.env.CHANNEL !== 'stable') { diff --git a/src/ext/conf/ExtConfPatches.js b/src/ext/conf/ExtConfPatches.js index 242e449..349a2c2 100644 --- a/src/ext/conf/ExtConfPatches.js +++ b/src/ext/conf/ExtConfPatches.js @@ -436,6 +436,15 @@ const ExtensionConfPatch = [ userOptions.sites['streamable.com'].css = '.player {text-align: left}' }; } + }, { + forVersion: '4.5.1.3', + updateFn: (userOptions, defaultOptions) => { + try { + userOptions.sites['wwww.disneyplus.com']['css'] = ".hudson-container {\n height: 100%;\n}"; + } catch (e) { + // do nothing if disney+ is missing + } + } } ]; diff --git a/src/ext/conf/ExtensionConf.js b/src/ext/conf/ExtensionConf.js index d8b3412..0da109d 100644 --- a/src/ext/conf/ExtensionConf.js +++ b/src/ext/conf/ExtensionConf.js @@ -1066,7 +1066,8 @@ var ExtensionConf = { "useRelativeAncestor": false, "playerNodeCss": "" } - } + }, + css: ".hudson-container { height: 100%; }", }, "www.twitch.tv": { mode: ExtensionMode.Enabled, @@ -1145,13 +1146,6 @@ var ExtensionConf = { }, css: 'video {\n width: 100% !important;\n height: 100% !important;\n}', }, - "www.disneyplus.com": { - DOM: { - player: { - periodicallyRefreshPlayerElement: true, - } - } - }, "imgur.com": { mode: -1, autoar: -1, diff --git a/src/ext/lib/comms/CommsClient.js b/src/ext/lib/comms/CommsClient.js index 8f6ef89..e6e0c30 100644 --- a/src/ext/lib/comms/CommsClient.js +++ b/src/ext/lib/comms/CommsClient.js @@ -11,7 +11,7 @@ class CommsClient { if (BrowserDetect.firefox) { this.port = browser.runtime.connect({name: name}); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { this.port = chrome.runtime.connect({name: name}); } diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index 21caaa9..3d787ca 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -485,9 +485,9 @@ class PlayerData { * NOTE: this method needs to be deleted once Edge gets its shit together. */ showEdgeNotification() { - if (BrowserDetect.isEdgeUA() && !this.settings.active.mutedNotifications?.browserSpecific?.edge?.brokenDrm?.[window.hostname]) { - this.ui = new PlayerUi(this.element, this.settings); - } + // if (BrowserDetect.isEdgeUA && !this.settings.active.mutedNotifications?.browserSpecific?.edge?.brokenDrm?.[window.hostname]) { + // this.ui = new PlayerUi(this.element, this.settings); + // } } } diff --git a/src/ext/uw-bg.js b/src/ext/uw-bg.js index 89c6351..df74b25 100644 --- a/src/ext/uw-bg.js +++ b/src/ext/uw-bg.js @@ -69,7 +69,7 @@ class UWServer { if(BrowserDetect.firefox) { browser.tabs.onActivated.addListener((m) => {this.onTabSwitched(m)}); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { chrome.tabs.onActivated.addListener((m) => {this.onTabSwitched(m)}); } } @@ -84,7 +84,7 @@ class UWServer { try { if (BrowserDetect.firefox || BrowserDetect.edge) { browser.tabs.insertCSS(sender.tab.id, {code: css, cssOrigin: 'user', frameId: sender.frameId}); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { chrome.tabs.insertCSS(sender.tab.id, {code: css, cssOrigin: 'user', frameId: sender.frameId}); } } catch (e) { @@ -95,7 +95,7 @@ class UWServer { try { if (BrowserDetect.firefox || BrowserDetect.edge) { browser.tabs.removeCSS(sender.tab.id, {code: css, cssOrigin: 'user', frameId: sender.frameId}); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { // this doesn't work currently, but hopefully chrome will get this feature in the future chrome.tabs.removeCSS(sender.tab.id, {code: css, cssOrigin: 'user', frameId: sender.frameId}); } @@ -141,7 +141,7 @@ class UWServer { let tab; if (BrowserDetect.firefox) { tab = await browser.tabs.get(this.currentTabId); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { tab = await this._promisifyTabsGet(chrome, this.currentTabId); } @@ -223,7 +223,7 @@ class UWServer { file: '/ext/uw-ui.js', allFrames: true, }); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { await new Promise( resolve => chrome.tabs.executeScript({ file: '/ext/uw-ui.js', @@ -269,7 +269,7 @@ class UWServer { async getCurrentTab() { if (BrowserDetect.firefox) { return (await browser.tabs.query({active: true, currentWindow: true}))[0]; - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { return new Promise((resolve, reject) => chrome.tabs.query({active: true, currentWindow: true}, (x) => resolve(x[0]))); } } diff --git a/src/manifest.json b/src/manifest.json index 75454b1..1e94bd3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Ultrawidify", "description": "Removes black bars on ultrawide videos and offers advanced options to fix aspect ratio.", - "version": "4.5.1.2", + "version": "4.5.1.3", "applications": { "gecko": { "id": "{cf02b1a7-a01a-4e37-a609-516a283f1ed3}" diff --git a/src/options/GeneralSettings.vue b/src/options/GeneralSettings.vue index 3aa2242..ce42e2f 100644 --- a/src/options/GeneralSettings.vue +++ b/src/options/GeneralSettings.vue @@ -216,7 +216,7 @@ export default { // reminder — webextension-polyfill doesn't seem to work in vue! await browser.permissions.request({permissions: ['downloads']}); browser.downloads.download({saveAs: true, filename: 'ultrawidify-settings.json', url: fileUrl}); - } else if (BrowserDetect.chrome) { + } else if (BrowserDetect.anyChromium) { const ths = this; chrome.permissions.request( diff --git a/src/popup/App.vue b/src/popup/App.vue index 5a67bbd..5e677fe 100644 --- a/src/popup/App.vue +++ b/src/popup/App.vue @@ -20,6 +20,17 @@ Build channel: {{BrowserDetect.processEnvChannel}} +
+
+ +
+
+ + NOTE: please ensure your Windows and Edge have the latest updates in order for this extension to work on DRM-protected sites. + If your Windows and Edge are not up to date, videos on sites like Netflix, Hulu, and Disney+ may not be aligned and cropped correctly. + +
+