Skip to content

Commit 32681cd

Browse files
committed
fix: hotfix for reloading tabs on state change
close #10
1 parent fae1c42 commit 32681cd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bg/action.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { browserAction, webNavigation, type Tabs, tabs } from 'webextension-polyfill';
1+
import { browserAction, /*webNavigation,*/ type Tabs, tabs } from 'webextension-polyfill';
22
import { getHostname, invertHostState } from './utils/storage';
3-
import { matcher as mapsUrlMatcher, runtimeMapUrl } from './bg';
3+
//import { matcher as mapsUrlMatcher, runtimeMapUrl } from './bg';
44

5-
const replacedUrlMatcher = new RegExp(`^${runtimeMapUrl}\?`);
5+
//const replacedUrlMatcher = new RegExp(`^${runtimeMapUrl}\?`);
66

77
/**
88
* Async function to react to clicks on the browser action icon.
@@ -18,15 +18,16 @@ async function actionClick(tab: Tabs.Tab): Promise<void> {
1818
let hostname = getHostname(tab.url);
1919
await invertHostState(hostname);
2020

21+
/*
2122
let frames = (await webNavigation.getAllFrames({ tabId: tab.id })) ?? [];
2223
2324
if (
2425
frames.some((frame) => {
2526
frame.url.match(replacedUrlMatcher) || frame.url.match(mapsUrlMatcher);
2627
})
27-
) {
28-
tabs.reload(tab.id, { bypassCache: true });
29-
}
28+
)
29+
*/
30+
tabs.reload(tab.id, { bypassCache: true });
3031
}
3132

3233
browserAction.onClicked.addListener(actionClick);

0 commit comments

Comments
 (0)