From e9abce61a0d9eb8ab6018b9324f02106b194dfe9 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 31 Dec 2019 16:14:50 -0500 Subject: [PATCH] Fix unescaped attr value in generated CSS selector Related feedback: - https://github.com/NanoAdblocker/NanoCore2/commit/5e625da8fe45#commitcomment-36625096 --- src/js/contentscript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index 01ed23f47..779f1fc3d 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -952,7 +952,7 @@ vAPI.domCollapser = (function() { if ( netSelectorCacheCount <= netSelectorCacheCountMax ) { const value = target.getAttribute(prop); if ( value ) { - selectors.push(tag + '[' + prop + '="' + value + '"]'); + selectors.push(`${tag}[${prop}="${CSS.escape(value)}"]`); netSelectorCacheCount += 1; } }