Skip to content

Commit

Permalink
fix: always reload tab on action click if frame
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Jul 9, 2023
1 parent 28a7692 commit 5b8efc2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bg/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ async function actionClick(tab: Tabs.Tab): Promise<void> {
await invertHostState(hostname);

let frames = (await webNavigation.getAllFrames({ tabId: tab.id })) ?? [];

// Added instead of commented below, as map currently isn't loaded properly on just frame reload...
if (frames.some((frame) => frame.url.match(replacedUrlMatcher) || frame.url.match(matcher))) {
tabs.reload(tab.id, { bypassCache: true });
return;
}

// TODO: check if reusable
/*
// matches osm frames (just reloading the frame ist not working for some reason, so in case of replaced maps the whole tab is reloaded)
if (frames.some((frame) => frame.url.match(replacedUrlMatcher))) {
tabs.reload(tab.id, { bypassCache: true });
Expand All @@ -35,6 +43,7 @@ async function actionClick(tab: Tabs.Tab): Promise<void> {
code: 'document.location.reload();',
});
});
*/
}

browserAction.onClicked.addListener(actionClick);

0 comments on commit 5b8efc2

Please sign in to comment.