[PM-5882] Adjust usage of `chrome.extension.getBackgroundPage` to ensure no conflicts exist due to the service worker (#8054)
This commit is contained in:
parent
87c75e5ac8
commit
d176a678e0
|
@ -306,7 +306,7 @@ export class BrowserApi {
|
|||
) {
|
||||
event.addListener(callback);
|
||||
|
||||
if (BrowserApi.isSafariApi && !BrowserApi.isBackgroundPage(window)) {
|
||||
if (BrowserApi.isSafariApi && !BrowserApi.isBackgroundPage(self)) {
|
||||
BrowserApi.trackedChromeEventListeners.push([event, callback]);
|
||||
BrowserApi.setupUnloadListeners();
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ export class BrowserApi {
|
|||
) {
|
||||
event.removeListener(callback);
|
||||
|
||||
if (BrowserApi.isSafariApi && !BrowserApi.isBackgroundPage(window)) {
|
||||
if (BrowserApi.isSafariApi && !BrowserApi.isBackgroundPage(self)) {
|
||||
const index = BrowserApi.trackedChromeEventListeners.findIndex(([_event, eventListener]) => {
|
||||
return eventListener == callback;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue