From 4e9d41a150bd119e416475f35c6bac8e2627b749 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 19 Nov 2015 18:07:27 -0500 Subject: [PATCH] #948: this possibly addresses the 1st reported error case --- platform/firefox/vapi-background.js | 5 ++++- src/js/cosmetic-filtering.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index b622458e8..360cc5aad 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -2240,7 +2240,10 @@ vAPI.net.registerListeners = function() { var browser = e.target; // I have seen this happens (at startup time) - if ( !browser.currentURI ) { + // https://github.com/gorhill/uBlock/issues/948 + // On older version of Firefox, `browser.webNavigation` can be null, + // which would cause currentURI to fail. + if ( !browser.webNavigation || !browser.currentURI ) { return; } diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index aa3b6941e..dc7e3bcd0 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -738,7 +738,7 @@ FilterContainer.prototype.compileGenericSelector = function(parsed, out) { if ( this.isValidSelector(selector) ) { out.push( 'c\vlg+\v' + - matches[0] + '\v' + + matches[0] + '\v' + selector ); } @@ -773,7 +773,7 @@ FilterContainer.prototype.compileGenericSelector = function(parsed, out) { if ( matches && matches.length === 2 ) { out.push( 'c\vlg+\v' + - matches[1] + '\v' + + matches[1] + '\v' + selector ); return;