From 9fbc50f14fdb0444b3841824414a16a61bf308a4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 11 Nov 2021 09:05:10 -0500 Subject: [PATCH] Harden detection of `//` in style declaration Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/1811#issuecomment-966323765 --- src/js/static-filtering-parser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 00cdcd074..4e0bf3f0d 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -1564,6 +1564,7 @@ Parser.prototype.SelectorCompiler = class { // https://github.com/uBlockOrigin/uBlock-issues/issues/668 // https://github.com/uBlockOrigin/uBlock-issues/issues/1693 + // https://github.com/uBlockOrigin/uBlock-issues/issues/1811 // Forbid instances of: // - `image-set(` // - `url(` @@ -1571,7 +1572,7 @@ Parser.prototype.SelectorCompiler = class { // - backslashes `\` // - opening comment `/*` compileStyleProperties(s) { - if ( /image-set\(|url\(|\/\/|\\|\/\*/i.test(s) ) { return; } + if ( /image-set\(|url\(|\/\s*\/|\\|\/\*/i.test(s) ) { return; } if ( this.stylesheet === null ) { return s; } let valid = false; try {