Skip to content

Commit

Permalink
Fix for first party context policy ignored on first load in new tabs …
Browse files Browse the repository at this point in the history
…(thanks ayi for reporting).
  • Loading branch information
hackademix committed Feb 20, 2022
1 parent f05e935 commit a703a07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bg/main.js
Expand Up @@ -232,7 +232,10 @@
// contextualData (e.g. a request details object) must contain a tab, a tabId or a documentUrl
// (used as a fallback if tab's top URL cannot be retrieved, e.g. in service workers)
let {tab, tabId, documentUrl, url} = contextualData;
if (!tab) tab = tabId !== -1 && TabCache.get(tabId);
if (!tab) {
if (contextualData.type === "main_frame") return url;
tab = tabId !== -1 && TabCache.get(tabId);
}
return tab && tab.url || documentUrl || url;
},
requestCan(request, capability) {
Expand Down

0 comments on commit a703a07

Please sign in to comment.