From 8c33720d16c00e6e2f759e54b4fbf1e710986ba4 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 8 Oct 2017 23:47:23 -0400 Subject: [PATCH] fix #3111 --- platform/chromium/manifest.json | 2 +- src/js/cosmetic-filtering.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index d1b66fa1b..5c8826760 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.14.12", + "version": "1.14.14", "commands": { "launch-element-zapper": { diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 3e4d56070..6020466c6 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -51,6 +51,14 @@ var isValidCSSSelector = (function() { } else { matchesFn = div.querySelector.bind(div); } + // https://github.com/gorhill/uBlock/issues/3111 + // Workaround until https://bugzilla.mozilla.org/show_bug.cgi?id=1406817 + // is fixed. + try { + matchesFn(':scope'); + } catch (ex) { + matchesFn = div.querySelector.bind(div); + } return function(s) { try { matchesFn(s + ', ' + s + ':not(#foo)');