abort-on-property-write
The abort-on-property-write snippet patches a property on the window object that aborts execution when the property is written or set. No error gets printed to the console.
Only use this snippet for written properties. Place it just inside the script you want to abort, otherwise, an error will be thrown.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
property |
The name of the property or path to the property (chain of properties separated by dots). |
Yes |
|
setConfigurable |
Value of the configurable attribute. Defaults to true. Setting to false prevents overwriting. |
No |
Filter examples
|
Filter |
Result |
|---|---|
|
|
The code that sets the |
|
|
The code that sets the |
|
|
The code that sets the |
Debugging
|
Message |
When |
Definition |
|---|---|---|
|
|
Beginning of execution |
No |
|
|
Each time property is set |
The error is about to be thrown. |
|
|
Before attaching to property |
Snippet is taking over the property getter/setter. |
Tradeoffs
-
The snippet is executed after all of a page's inline scripts.
-
You can only attach this snippet to global properties, or properties of the
windowobject. -
You should only attach to properties set just inside the script you want to abort.