Skip to content

Commit 08670a7

Browse files
committed
Better blob: URL support.
1 parent ae4c056 commit 08670a7

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/bg/RequestGuard.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,16 @@ var RequestGuard = (() => {
254254
let TAG = `<${policyType.toUpperCase()}>`;
255255
let origin = Sites.origin(url);
256256
let {siteKey} = Sites.parse(url);
257-
let options;
258-
if (siteKey === origin) {
259-
origin = new URL(url).protocol;
260-
}
261-
options = [
262-
{label: _("allowLocal", siteKey), checked: true},
263-
{label: _("allowLocal", origin)},
264-
{label: _("CollapseBlockedObjects")},
257+
const options = [
258+
{label: _("allowLocal", siteKey), checked: true}
265259
];
260+
if (!url.startsWith("blob:")) {
261+
if (siteKey === origin) {
262+
origin = new URL(url).protocol;
263+
}
264+
options.push({label: _("allowLocal", origin)});
265+
}
266+
options.push({label: _("CollapseBlockedObjects")});
266267
let t = u => `${TAG}@${u}`;
267268
let ret = await Prompts.prompt({
268269
title: _("BlockedObjects"),

src/content/staticNS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
return;
8686
}
8787

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

src/nscl

Submodule nscl updated 1 file

0 commit comments

Comments
 (0)