PhantomJS (as of version 1.6.1, released Jul 24th 2012) offers a way to set custom request headers using
. It works great to the extent that it creates and sends the http request with your custom headers. It fails however to set the
I created a workaround to fake the referrer with a phantomJS Script, and a patch that changes the behaviour of phantomJS. You can use both, depending on your needs. The Workaround includes an additional pageload for every requests and is not 100% reliable since its based on injecting a link to the (referring) page and simulating the click. This is probably not what you want for larger scale tests and scans.
You can find my basic fix on Github. It passes your custom Headers to the request object and thereby makes the referrer visible to the page: https://github.com/papoms/phantomjs/commit/6f738b06a02e2aaee1c18859b76132e5932334e0
Share or like this article, to let me know if it helped you!
Moin moin / Hey there!
My name is Paul Porzky, COO of the KeywordDomains.com GmbH, based in Münster - Germany. I studied business administration in the Netherlands but have a strong technical background and years of experience with domains, online marketing, webtechnologies & making sense of big volumes of data. Keyworddomains evolved a lot over the years so did the focus of my work and the technologies used. I believe in the power of technology and a good team and am happy to have one around me!