Injecting Scripts

You can run JavaScript code snippets inside the analysed page, either when the page first starts loading, or after the page has finished loading.

Some use cases:

  • Set a cookie that hides a GDPR notice
  • Click a "Save" button during analysis, so that the save request is available when loading a page archive

How to set up script injection

You can either set up scripts to inject when creating a page, or later on by clicking "edit" when viewing the page results.

Edit the page

Expand the "Inject Scripts" section here:

Select or create a script

There are two types of scripts.

Scripts that run before the page starts loading let you set preconditions or configuration for your page.

Scripts that run after the page finished loading allow you to script interactions that cause more data to be captured about your page. For example, you can use this to make sure certain requests are part of your page archives.

When you create or edit a script you'll see a modal were you can enter your code snippet.

Save your page changes

After saving the script, click "Update" to save the page.


Still need help? Contact matt@debugbear.com for support.