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

Forbid instances of /* in :style() operator

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1693
This commit is contained in:
Raymond Hill 2021-08-25 07:43:26 -04:00
parent 5e6600a5cc
commit a2d8545382
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1539,8 +1539,13 @@ Parser.prototype.SelectorCompiler = class {
} }
// https://github.com/uBlockOrigin/uBlock-issues/issues/668 // https://github.com/uBlockOrigin/uBlock-issues/issues/668
// https://github.com/uBlockOrigin/uBlock-issues/issues/1693
// Forbid instances of:
// - `url(`
// - backslashes `\`
// - opening comment `/*`
compileStyleProperties(s) { compileStyleProperties(s) {
if ( /url\(|\\/i.test(s) ) { return; } if ( /url\(|\\|\/\*/i.test(s) ) { return; }
if ( this.div === null ) { return s; } if ( this.div === null ) { return s; }
this.div.style.cssText = s; this.div.style.cssText = s;
if ( this.div.style.cssText === '' ) { return; } if ( this.div.style.cssText === '' ) { return; }