Skip to content

Commit b90b564

Browse files
committed
Filter out tabs with no accessible url from context matching routine.
1 parent c37a11e commit b90b564

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bg/DNRPolicy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
const cascade = ns.sync.cascadeRestrictions;
216216
const ctxSettings = [...policy.sites].filter(([siteKey, perms]) => perms.contextual?.size);
217217
const tabs = (ctxSettings.length || cascade) &&
218-
(await browser.tabs.query({})).filter(tab => !ns.unrestrictedTabs.has(tab.id));
218+
(await browser.tabs.query({})).filter(tab => tab.url && !ns.unrestrictedTabs.has(tab.id));
219219
if (!tabs?.length) {
220220
return rules;
221221
}
@@ -308,7 +308,7 @@
308308
if (policy.autoAllowTop) {
309309
for(const tab of tabs) {
310310
const {url} = tab;
311-
if (Sites.isInternal(url)) continue;
311+
if (!url || Sites.isInternal(url)) continue;
312312
const perms = policy.get(url).perms;
313313
console.debug("DNRPolicy autoAllow check", tab, perms, perms === policy.DEFAULT);
314314
if (perms === policy.DEFAULT || (isStartup && perms.temp)) {

0 commit comments

Comments
 (0)