From 9d2b480f3fb5fcc4840095f18736a38d2712500f Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 29 Mar 2021 21:15:01 +0200 Subject: [PATCH] Use webextension-polyfill in popup --- src/popup/App.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/popup/App.vue b/src/popup/App.vue index a92f50f..05ed175 100644 --- a/src/popup/App.vue +++ b/src/popup/App.vue @@ -222,6 +222,7 @@ import AboutPanel from './panels/AboutPanel'; import ExtensionMode from '../common/enums/ExtensionMode.enum'; import Logger from '../ext/lib/Logger'; import {ChromeShittinessMitigations as CSM} from '../common/js/ChromeShittinessMitigations'; +import { browser } from 'webextension-polyfill-ts'; export default { data () { @@ -260,7 +261,8 @@ export default { await this.settings.init(); this.settingsInitialized = true; - const port = BrowserDetect.firefox ? browser.runtime.connect({name: 'popup-port'}) : chrome.runtime.connect({name: 'popup-port'}); + // const port = BrowserDetect.firefox ? browser.runtime.connect({name: 'popup-port'}) : chrome.runtime.connect({name: 'popup-port'}); + const port = browser.runtime.connect({name: 'popup-port'}); port.onMessage.addListener( (m,p) => this.processReceivedMessage(m,p)); CSM.setProperty('port', port);