Steps to Use Requestly 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
- Selenium
- Playwright
- Puppeteer
3
Download the Requestly CRX Extension
If you’re using our NPM package, you don’t need to download it. Simply call the function
getExtension().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 CRX extension
For JavaScript, use our NPM package
@requestly/rq-automation.Learn more →- Selenium
- Playwright
- Puppeteer
For Javascript ( Node.js )For PythonFor Java
5
Close Extension Welcome Page
When Chrome installs the Requestly extension, it may open a “welcome” (post-install) tab that interrupts automation. You can close this tab programmatically:
- Selenium
- Playwright
- Puppeteer
- With NPM Package
6
Perform Header Modifications Using Automation URLs
Once the browser is launched with Requestly, hit the following URLs to programmatically apply rules:
- Normal way
- NPM package
Add Request Header
To add multiple headers, simply append them using the
& symbol like this:?header1=value1&header2=value2&header3=value3Add Response Header
Remove Request Headers
To remove multiple headers, simply append them using the
& symbol like this:?header1&header2&header3Remove 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.- Normal way
- NPM package

