From f174ddab68e6f5fccb5d02737762ae15fd895d56 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 22 Dec 2020 03:21:14 +0100 Subject: [PATCH] Only show the popup in Edge --- src/ext/conf/BrowserDetect.js | 1 + src/ext/lib/video-data/PlayerData.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ext/conf/BrowserDetect.js b/src/ext/conf/BrowserDetect.js index 0c28caa..702ed1c 100644 --- a/src/ext/conf/BrowserDetect.js +++ b/src/ext/conf/BrowserDetect.js @@ -9,6 +9,7 @@ const BrowserDetect = { edge: process.env.BROWSER === 'edge', processEnvBrowser: process.env.BROWSER, processEnvChannel: process.env.CHANNEL, + isEdgeUA: () => /Edg\/(\.?[0-9]*)*$/.test(window.navigator.userAgent) } if (process.env.CHANNEL !== 'stable') { diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index 8abbd13..f04bc5e 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -3,6 +3,7 @@ import ExtensionMode from '../../../common/enums/extension-mode.enum' import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import PlayerNotificationUi from '../uwui/PlayerNotificationUI'; import PlayerUi from '../uwui/PlayerUI'; +import BrowserDetect from '../../conf/BrowserDetect'; if (process.env.CHANNEL !== 'stable'){ console.info("Loading: PlayerData.js"); @@ -45,8 +46,13 @@ class PlayerData { this.extensionMode = videoData.extensionMode; this.invalid = false; this.element = this.getPlayer(); + this.notificationService = new PlayerNotificationUi(this.element, this.settings); - this.ui = new PlayerUi(this.element, this.settings); + + if (BrowserDetect.isEdgeUA()) { + this.ui = new PlayerUi(this.element, this.settings); + } + this.dimensions = undefined; this.overlayNode = undefined;