Avoid using fallback origins for main_frame loads.

This commit is contained in:
hackademix 2022-09-08 23:32:17 +02:00
parent 63d173f632
commit 343d1e5d09
1 changed files with 7 additions and 4 deletions

View File

@ -357,12 +357,15 @@ var RequestGuard = (() => {
let normalizeRequest = request => {
function fakeOriginFromTab({tabId} = request) {
function fakeOriginFromTab({tabId, type} = request) {
if (type !== "main_frame") {
let tab = tabId !== -1 && TabCache.get(tabId);
if (tab) {
return request.initiator = request.originUrl = request.documentUrl = tab.url;
}
}
return request.initiator || request.originUrl;
}
if ("initiator" in request && !("originUrl" in request)) {
if (request.initiator === "null") {