override-property-read
The
override-property-read
snippet overrides a property's value on the window
object with a set of available properties.You can use the
override-property-read
snippet to change the value of global properties.Name | Description |
---|---|
property | The name of the property or path to the property. If the property is a direct child of window , this parameter will be the property name. If you want to access a sub property, though, this parameter becomes a chain of properties separated by dots. |
value | The value to override the property with. |
Value | Definition |
---|---|
undefined | |
false | |
true | |
null | |
" " | An empty string |
decimal integer | |
noopFunc | A function with an empty body |
trueFunc | A function that returns true |
emptyArray | An array with no elements |
emptyObj | An object with no properties |
The following table lists examples that use the
override-property-read
snippet:Filter | Result |
---|---|
override-property-read adConfig undefined | adConfig has the value of undefined . |
override-property-read shouldShowAds falseFunc | shouldShowAds has the value of a function that returns false when called. |
override-property-read config.adCount 0 | config.adCount has the value of 0 . |
The following table contains messages you'll find useful during debugging:
Message | When the message occurs | Definition |
---|---|---|
<property> override done | Each time the property is read | The property has been accessed. |
Overrding <property> | Right before attaching to the property | This log is printed just before the snippet takes over the property getter OR setter. |
Last modified 2mo ago