Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

When working in this mode, you do not need to specify the return keyword if you want to return some value. The result of this action will be the value calculated in the last line of the action. In the example below, the value “6” will get into the project variable {-Variable.result-}, the result of the expression 2 + 2 * 2.

...

On the current page

The code will be executed in the browser (current instance). This method should be used to work with the DOM tree of the page, to interact with the elements of the page.

When working in this mode, you have access to all objects of the current page, including you can use libraries and frameworks connected to the site (for example jQuery).

On extension page

The code will be executed in the context of the activated extension.

When creating a page window

The script will execute during the DOMWindowCreated event. Using this mode, you can override any JavaScript objects before the first access to them on the site. This mode has several options:

  • one time - the code will be executed once;

  • on the domain - the code will be executed every time a window is created for the specified domain (if the “In all tabs” option is checked, the code is executed in all tabs of the instance)

  • every time - the code is executed every time a window is created, regardless of the domain (if the “In all tabs” option is checked, the code is executed in all tabs of the instance)

On page load

In this case, the script is executed during the DOMContentLoaded event. One use case: to disable the display of unnecessary or obstructing elements on the page

...