Skip to content

Custom headers #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ShayanArifButt opened this issue Oct 19, 2017 · 1 comment
Open

Custom headers #31

ShayanArifButt opened this issue Oct 19, 2017 · 1 comment
Assignees

Comments

@ShayanArifButt
Copy link

ShayanArifButt commented Oct 19, 2017

how to add custom header ?

this is custom header option:
http://phantomjs.org/api/webpage/property/custom-headers.html

but in where should i add this ? i itried to add in "PJCtrl.js" file , but then my php script kept on loading infinitely. I tried to add like this in "PJCtrl.js" file

`function configurePage(windowObj)
{
try {

	if (typeof windowObj.pjsPage == 'undefined') {
		windowObj.pjsPage			= webpage.create();
		
		windowObj.pjsPage.customHeaders = {
			"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
			"Accept-Language:en-US,en;q=0.8",
			"Connection:keep-alive",
			"User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36"
		};
		
	}`
@ShayanArifButt ShayanArifButt changed the title Custome headers Custom headers Oct 19, 2017
@merlinthemagic merlinthemagic self-assigned this Oct 31, 2017
@merlinthemagic
Copy link
Owner

fork master-dev and make the changes in the fork, then ping me when you are ready to discuss the implementation of this new feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants