Skip to content

Commit

Permalink
Fixed: Auto-reopening tab in container (in fg): Handle only GET requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Aug 31, 2023
1 parent cc0c2df commit dd44210
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/services/web-req.fg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ function onBeforeRequestHandler(info: browser.webRequest.ReqDetails): optBlockin
const tab = Tabs.byId[info.tabId]
if (!tab) return

if (handledReqId !== info.requestId && tab.reopenInContainer) {
if (handledReqId !== info.requestId && tab.reopenInContainer && info.method === 'GET') {
handledReqId = info.requestId

const panel = Sidebar.panelsById[tab.panelId]
if (Utils.isTabsPanel(panel) && panel.newTabCtx === tab.reopenInContainer) {
const dst = { panelId: tab.panelId, containerId: tab.reopenInContainer }
const item = { id: tab.id, url: info.url, active: tab.active, index: tab.index }
delete tab.reopenInContainer
if (info.method == "POST") {
Logs.warn("onBeforeRequestHandler not reopening, POST.")
return {}
}
Tabs.reopen([item], dst)
return { cancel: true }
}
Expand Down

0 comments on commit dd44210

Please sign in to comment.