Using Insert Scripts Rule, you can make on-the-fly changes to a webpage content. It allows you to automate, scrape & change webpages behaviour without needed to access the page source code.
- Source Condition: Source condition is where you set criteria for the rules. You can use
URL
,Host
, orPath
withRegex
,Contains
,Wildcard
, orEquals
to match the source request. Learn more about source conditions here.
- Script Language: The specific script language (JS/CSS) that needs to be inserted.
- Script Source: Source Code or URL of the script that needs to be inserted.
- Script Load Time: When is the script loaded in the webpage. (Before Page Load/After Page Load).
- Define Custom Attributes: Enables you to add pre-defined(defer, async etc.) or custom attributes to script tag on insert.
Popular Use Cases
- Inject popular libraries or hosted scripts or execute custom code-snippet before or after page load using a simple rule builder.
- Test & demonstrate SaaS applications like website widgets and monitoring scripts on target websites.
FAQs
-
Is there a way to inject the script only in the main document and not in the iframe?
Yes, advanced filter targeting can be used to select the resource type.
You can inject the script in only the main document or only in the iframe.