Skip to main content
In this guide, we’ll walk through how to integrate Requestly Interceptor into any browser-based automation framework (Selenium, Playwright, Puppeteer, etc.) to programmatically modify request and response headers.

Steps to Use Requestly Interceptor for Header Modification in Automation

We also offer an NPM package, @requestly/rq-automation, to make this easier.
Learn more →
1

Install Chrome for Testing

Download Chrome for Testing, the automation-friendly version of Chrome.
Why Chrome for Testing?Starting with Chrome 137, official Chrome builds no longer support the --load-extension flag due to security concerns. There commit →To load extensions in automation tools (Selenium, Playwright, Puppeteer, etc.), you must use Chrome for Testing or Chromium.Regular Chrome will block extension loading via automation. Use Chrome for Testing to avoid breakages and ensure compatibility.
2

Install the Automation Tool of Your Choice

3

Download the Requestly Interceptor CRX Extension

If you’re using our NPM package, you don’t need to download it. Simply call the function getExtension().
Download the CRX file of the Requestly Interceptor Extension.
4

Configure the Browser with the Extension

Use your automation tool’s configuration options to:
  • Set the path to Chrome for Testing binary
  • Add the Requestly Interceptor CRX extension
For JavaScript, use our NPM package @requestly/rq-automation.
Learn more →
For Javascript ( Node.js )
For Python
For Java
5

Close Extension Welcome Page

When Chrome installs the Requestly Interceptor extension, it may open a “welcome” (post-install) tab that interrupts automation. You can close this tab programmatically:
6

Perform Header Modifications Using Automation URLs

Once the browser is launched with Requestly Interceptor, hit the following URLs to programmatically apply rules:

Add Request Header

To add multiple headers, simply append them using the & symbol like this:
?header1=value1&header2=value2&header3=value3

Add Response Header

Remove Request Headers

To remove multiple headers, simply append them using the & symbol like this:
?header1&header2&header3

Remove Response Headers

7

Test on a Live Site

To verify if the headers are successfully modified, open https://testheaders.com in the automated browser and inspect the headers shown.You may need to trigger a button click to reveal headers on some pages.

Complete Working Example in Selenium ( Javascript )

Here’s a working example using Selenium, but this logic can be adapted easily to Playwright, Puppeteer, or others.