mirror of https://github.com/gorhill/uBlock.git
Improve set-constant.js scriptlet
The scriptlet will now still try to trap a specific property if a segment of the chain is not undefined while yet not an object either. For example, this now allows to set a value on `document.body.onselectstart` when `document.body` has not been instantiated yet by the browser parser, whereas this would previously fail because `document.body` would be `null` while the scriptlet was testing against `undefined`.
This commit is contained in:
parent
04021424d0
commit
14ebfbea27
|
@ -549,7 +549,7 @@
|
|||
const prop = chain.slice(0, pos);
|
||||
let v = owner[prop];
|
||||
chain = chain.slice(pos + 1);
|
||||
if ( v !== undefined ) {
|
||||
if ( v instanceof Object ) {
|
||||
makeProxy(v, chain);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue