Better blob: URL support.

This commit is contained in:
hackademix 2023-03-20 23:35:59 +01:00
parent ae4c056b0d
commit 08670a7353
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
3 changed files with 11 additions and 10 deletions

View File

@ -254,15 +254,16 @@ var RequestGuard = (() => {
let TAG = `<${policyType.toUpperCase()}>`;
let origin = Sites.origin(url);
let {siteKey} = Sites.parse(url);
let options;
if (siteKey === origin) {
origin = new URL(url).protocol;
}
options = [
{label: _("allowLocal", siteKey), checked: true},
{label: _("allowLocal", origin)},
{label: _("CollapseBlockedObjects")},
const options = [
{label: _("allowLocal", siteKey), checked: true}
];
if (!url.startsWith("blob:")) {
if (siteKey === origin) {
origin = new URL(url).protocol;
}
options.push({label: _("allowLocal", origin)});
}
options.push({label: _("CollapseBlockedObjects")});
let t = u => `${TAG}@${u}`;
let ret = await Prompts.prompt({
title: _("BlockedObjects"),

View File

@ -85,7 +85,7 @@
return;
}
if (origin !== 'null' && window.location.origin !== origin) {
if (origin !== 'null' && (window.location.origin !== origin || url.startsWith(`blob:${origin}/`))) {
debug("Fetching policy for actual URL %s (was %s)", origin, url);
url = origin;
}

@ -1 +1 @@
Subproject commit 9999407711d4be91ab06d664b40ec9110e764649
Subproject commit 3d3ebed08fe4e23813934935b26019d572915156