this fixes dealing with browser objects with no valid URI

This commit is contained in:
gorhill 2015-06-01 18:12:33 -04:00
parent ba654596c8
commit 2ca1ed3b9c
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}