Comment on page
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 | Mandatory |
---|---|---|
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. | Yes |
value | The value to override the property with. | Yes |
setConfigurable | Value of the configurable attribute of the descriptor of property. If this parameter is not used it defaults to true. Setting it to false will prevent the property set and get being overwritten or otherwise changed by anybody.
If this snippet doesn't work as expected when passing only the property and the value, it could mean that the website is circumventing and setting this parameter to false can come in handy. | No |
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 adConfig undefined false | adConfig has the value of undefined and it is no longer configurable . |
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 6d ago