From 3b0d214633e6d5029e02b420a31c5ddc631fef18 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 13 Jul 2019 07:49:07 -0400 Subject: [PATCH] Mind escape sequences when validating `:style` filters Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/668 --- src/js/static-ext-filtering.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/static-ext-filtering.js b/src/js/static-ext-filtering.js index 552d60682..6e4a6d1dc 100644 --- a/src/js/static-ext-filtering.js +++ b/src/js/static-ext-filtering.js @@ -651,7 +651,6 @@ api.compileSelector = (function() { const reAfterBeforeSelector = /^(.+?)(::?after|::?before|::[a-z-]+)$/; const reStyleSelector = /^(.+?):style\((.+?)\)$/; - const reStyleBad = /url\(/; const reExtendedSyntax = /\[-(?:abp|ext)-[a-z-]+=(['"])(?:.+?)(?:\1)\]/; const reExtendedSyntaxParser = /\[-(?:abp|ext)-([a-z-]+)=(['"])(.+?)\2\]/; const div = document.createElement('div'); @@ -671,6 +670,8 @@ div.style.cssText = ''; return true; }; + // https://github.com/uBlockOrigin/uBlock-issues/issues/668 + const reStyleBad = /url\(|\\/i; const entryPoint = function(raw) { entryPoint.pseudoclass = false;