Skip to content

Commit

Permalink
Don't reopen during POSTs. (#1205)
Browse files Browse the repository at this point in the history
This can happen, for example, when something loads a file:// URL, that
then has static form data and javascript to immediately submit it.

We then turn the POST with data in the default container into a GET with
no data in the target container.

That doesn't work very well.

As such, let's just refuse to reopen a tab in a new container during a
POST, we can't bring the data with us (that I've figured out how to do
anyhow).

Co-authored-by: Zeph / Liz Loss-Cutler-Hull <warp@aehallh.com>
  • Loading branch information
zelch and Zeph / Liz Loss-Cutler-Hull authored Aug 31, 2023
1 parent 2cf482e commit cc0c2df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/web-req.fg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function onBeforeRequestHandler(info: browser.webRequest.ReqDetails): optBlockin
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 cc0c2df

Please sign in to comment.