Fix for first party context policy ignored on first load in new tabs (thanks ayi for reporting).

This commit is contained in:
hackademix 2022-02-20 08:58:41 +01:00
parent f05e935de7
commit a703a075f4
1 changed files with 4 additions and 1 deletions

View File

@ -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) {