Custom JavaScript
Dan Sharp
Posted 7 May, 2024 by Dan Sharp in
Custom JavaScript
The custom JavaScript tab works alongside the custom JavaScript configuration. This feature allows you to exectute custom JS snippets to perform actions or extract data while crawling and can be configured under ‘Config > Custom > Custom JavaScript’.
You’re able to configure up to 100 JS Snippets in the custom JavaScript configuration. Custom JS snippets are run against internal URLs only.
The results appear within the custom JavaScript tab as outlined below.
Columns
This tab includes the following columns.
- Address – The URL crawled.
- Content Type – The content type of the URL.
- Status Code – HTTP response code.
- Status – The HTTP header response.
- [Snippet Name] – Column heading names are dynamic based upon the name provided to each snippet. Each snippet will have a seperate named column, which will contain the data extracted against each URL.
Filters
This tab includes the following filters.
- [Snippet Name] – Filters are dynamic, and will match the name of the snippets and relevant column. They show the relevant snippet column against the URLs.
Please note: Only snippets set up as an ‘Extraction’ type will appear in the custom JavaScript tab and have a filter, or column. ‘Action’ snippets perform an action, rather than extract data, and therefore will not appear.
Please read our tutorial on ‘How to Debug Custom JavaScript Snippets‘.