Better blob: URL support.
This commit is contained in:
parent
ae4c056b0d
commit
08670a7353
|
@ -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"),
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
2
src/nscl
2
src/nscl
|
@ -1 +1 @@
|
|||
Subproject commit 9999407711d4be91ab06d664b40ec9110e764649
|
||||
Subproject commit 3d3ebed08fe4e23813934935b26019d572915156
|
Loading…
Reference in New Issue