Lightweight web browser for testing

I have e very specific test setup in mind. I would like to start a web-browser that understands Javascript and can use HTTP proxy, point it to a URL (ideally by specifying it in the command line along with the proxy config), wait for the page to load while listening (in the proxy) requests are generated as web-page is rendered and Javascript is executed, then kill the whole thing and restart. I don’t care about how the page renders graphically at all. Which browser or tool should I use for this? Ideally it should be something self-contained that doesn’t require

Are tags subject to the same CORS restrictions as javascript/fetch calls?

It’s common practice to include scripts from other origins with script tags but when you use fetch calls on other origins then everything must be configured carefully other wise you will get a CORS error. Does the script tag somehow bypass CORS? How does that work? Answer The Same Origin Policy prevents JavaScript reading data from other origins without permission (which is usually provided by CORS). Running JavaScript from other origins is not prevented by the Same Origin Policy (nor is loading stylesheets, displaying images, content in iframes, etc). JavaScript in the page can’t (usually) read sensitive data from other

How to spoof site referrer?

I have 2 pages : 1.php and 2.php When the user arrives on 2.php, i want to show on 2.php that the user is arriving from google.com and NOT from 1.php I tried spoofing the header of 2.php using when i do a javascript document.write(document.referrer); it shows me 1.php Any help is appreciated. Answer The http referrer is a request header. The server (PHP) can only set response headers. Thus the only way to spoof a referrer is for the client to do it, usually via some sort of browser plugin.