From 2ca1ed3b9cab612a52eb25fe91e46d7465cd7fdb Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 1 Jun 2015 18:12:33 -0400 Subject: [PATCH] this fixes dealing with browser objects with no valid URI --- platform/firefox/vapi-background.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index c14d4c3fd..37344a38e 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1561,8 +1561,12 @@ vAPI.net.registerListeners = function() { for ( var tab of tabWatcher.tabs() ) { var URI = tab.currentURI; - // Probably isn't the best method to identify the source tab - if ( URI.spec !== details.openerURL ) { + // Probably isn't the best method to identify the source tab. + // Apparently URI can be undefined under some circumstances: I + // believe this may have to do with those very temporary + // browser objects created when opening a new tab, i.e. related + // to https://github.com/gorhill/uBlock/issues/212 + if ( URI && URI.spec !== details.openerURL ) { continue; }