diff --git a/src/csui/PlayerUiComponent.vue b/src/csui/PlayerUiComponent.vue index b5d5dbe..a08f990 100644 --- a/src/csui/PlayerUiComponent.vue +++ b/src/csui/PlayerUiComponent.vue @@ -83,6 +83,7 @@ import { mapState } from 'vuex'; import Icon from '../common/components/Icon'; import BrowserDetect from '../ext/conf/BrowserDetect'; +import Settings from '../ext/lib/Settings'; export default { components: { @@ -110,6 +111,25 @@ export default { methods: { getUrl(url) { return BrowserDetect.firefox ? browser.runtime.getURL(url) : chrome.runtime.getURL(url); + }, + async hidePopupForever() { + const settings = new Settings(); + await settings.init(); + + if (!settings.active.mutedNotifications) { + settings.active.mutedNotifications = {}; + } + if (!settings.active.mutedNotifications?.browserSpecific) { + settings.active.mutedNotifications.browserSpecific = { + edge: { + brokenDrm: { + } + } + }; + } + settings.active.mutedNotifications.browserSpecific.edge.brokenDrm[window.location.hostname] = true; + + await settings.saveWithoutReload(); } } } diff --git a/src/ext/conf/ExtConfPatches.js b/src/ext/conf/ExtConfPatches.js index d6b8df4..f2dcef6 100644 --- a/src/ext/conf/ExtConfPatches.js +++ b/src/ext/conf/ExtConfPatches.js @@ -407,7 +407,7 @@ const ExtensionConfPatch = [ } } }, { - forVersion: '4.5.0.1', + forVersion: '4.5.1', updateFn: (userOptions, defaultOptions) => { for (const site in userOptions.sites) { try { diff --git a/src/ext/lib/ar-detect/ArDetector.js b/src/ext/lib/ar-detect/ArDetector.js index 663ec66..c73132b 100644 --- a/src/ext/lib/ar-detect/ArDetector.js +++ b/src/ext/lib/ar-detect/ArDetector.js @@ -9,6 +9,7 @@ import GuardLine from './GuardLine'; import VideoAlignment from '../../../common/enums/video-alignment.enum'; import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import {sleep} from '../../lib/Util'; +import BrowserDetect from '../../conf/BrowserDetect'; class ArDetector { @@ -557,10 +558,18 @@ class ArDetector { } catch (e) { this.logger.log('error', 'arDetect', `%c[ArDetect::frameCheck] <@${this.arid}> %c[ArDetect::frameCheck] can't draw image on canvas. ${this.canDoFallbackMode ? 'Trying canvas.drawWindow instead' : 'Doing nothing as browser doesn\'t support fallback mode.'}`, "color:#000; backgroud:#f51;", e); + console.log('video is protected by DRM', this.drmNotificationShown) // nothing to see here, really, if fallback mode isn't supported by browser if (!this.drmNotificationShown) { this.drmNotificationShown = true; - this.conf.player.showNotification('AARD_DRM'); + + // if we detect Edge, we'll throw the aggressive popup + if (BrowserDetect.isEdgeUA() && !this.settings.active.mutedNotifications?.browserSpecific?.edge?.brokenDrm?.[window.hostname]) { + new PlayerUi(this.element, this.settings); + } else { + this.conf.player.showNotification('AARD_DRM'); + } + this.conf.resizer.setAr({type: AspectRatio.Reset}); return; } diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index f04bc5e..79a9253 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -49,10 +49,6 @@ class PlayerData { this.notificationService = new PlayerNotificationUi(this.element, this.settings); - if (BrowserDetect.isEdgeUA()) { - this.ui = new PlayerUi(this.element, this.settings); - } - this.dimensions = undefined; this.overlayNode = undefined;