1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-24 03:12:46 +01:00

Forbid usage of inage-set as style property

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1811

Additionally, forbid style declaration with at least one
instance of `//` at any position.
This commit is contained in:
Raymond Hill 2021-11-11 08:33:28 -05:00
parent 36faf27c69
commit 5d22b51668
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1565,11 +1565,13 @@ Parser.prototype.SelectorCompiler = class {
// https://github.com/uBlockOrigin/uBlock-issues/issues/668
// https://github.com/uBlockOrigin/uBlock-issues/issues/1693
// Forbid instances of:
// - `image-set(`
// - `url(`
// - any instance of `//`
// - backslashes `\`
// - opening comment `/*`
compileStyleProperties(s) {
if ( /url\(|\\|\/\*/i.test(s) ) { return; }
if ( /image-set\(|url\(|\/\/|\\|\/\*/i.test(s) ) { return; }
if ( this.stylesheet === null ) { return s; }
let valid = false;
try {