From 338b2191420417c73e478667eaa6dd69dd0f31d9 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 12 Apr 2021 20:36:42 +0200 Subject: [PATCH] Since webExt polyfill ensures 'browser' is also present in Chrome, code for opening settings page from popup stopped working in Chrome --- src/popup/panels/VideoPanel.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/popup/panels/VideoPanel.vue b/src/popup/panels/VideoPanel.vue index 175b3cf..5abad9d 100644 --- a/src/popup/panels/VideoPanel.vue +++ b/src/popup/panels/VideoPanel.vue @@ -126,6 +126,7 @@ import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser'; import ShortcutButton from '../../common/components/ShortcutButton'; import ComputeActionsMixin from '../../common/mixins/ComputeActionsMixin'; import CropModePersistence from '../../common/enums/CropModePersistence.enum'; +import BrowserDetect from '../../ext/conf/BrowserDetect'; export default { data() { @@ -157,7 +158,11 @@ export default { }, methods: { async openOptionsPage() { - (browser ?? chrome).runtime.openOptionsPage(); + if (BrowserDetect.firefox) { + browser.runtime.openOptionsPage(); + } else { + chrome.runtime.openOptionsPage(); + } }, execAction(action) { this.exec.exec(action, 'page', this.frame);