abort-on-property-read

abort-on-property-read

The abort-on-property-read snippet patches a property on the window object that aborts execution when the property is read. No error gets printed to the console.

Only use this snippet for read 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 for sub-properties).

Yes

setConfigurable

Value of the configurable attribute of the descriptor. Defaults to true. Setting to false prevents the property from being overwritten.

No

Filter examples

Filter

Result

abort-on-property-read atob

The code that reads/calls the atob global function throws an exception.

abort-on-property-read adHandler.cmd.push

The code that reads/calls the push function throws an exception.

abort-on-property-read Object.prototype.adfoxCode

The code that reads/calls the adfoxCode property throws an exception.

Debugging

Message

When

Definition

no property to abort on read

Beginning of execution

No property parameter was passed.

<property> access aborted

Each time property is read

The error is about to be thrown.

aborting on <property> access

Before attaching to property

Snippet is taking over the property getter/setter.

Tradeoffs

  • The snippet is executed after all a page's inline scripts. Attach only properties read inside of a callback.

  • You can only attach this snippet to global properties, or properties of the window object.