-
Notifications
You must be signed in to change notification settings - Fork 63
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
Added an option for adding key/values to phjs' page.customHeaders #21
Conversation
Can you reformat Also, I'm a slightly concerned about the precedent for specifying custom options here. Should this option that directly maps to the underlying What if we structure the options differently, such that there's a Thoughts? |
Re: established convention for var declarations: Definitely. (I prefer coffeescript so I just ran it through I agree with the change to make it an option format like:
I'll do both those changes. I'll also make the Did you have any thoughts about the tiny expressjs server sitting in the Thanks for the quick response! |
Pushed those changes. |
page[prop] = options.page[prop]; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.extend()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Thanks @sindresorhus, I made those changes. |
Hmm, adding the code to add arbitrary properties on the @pconerly, could you verify that the |
Hi @jakerella, Yup, it does pass on any page properties listed here: https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage I added a test for viewport size so you can be assured. You can close #31. You're welcome! |
Bump... May I ask why this one is waiting to be merged? We use this functionality for |
Just in case somebody is looking for a more unobtrusive way to do this (e.g. no extra libraries required): https://github.com/Nostraa/grunt-lib-phantomjs/commit/54b4cc693e22e47836484a7d193d3001c7c851a2 |
Could this please be merged? I have tests that rely on document.getElementAtPoint() that are failing because the viewport size is too small. |
@cowboy @sindresorhus , can we merge? |
By the way, rather than include lodash, this can be simply fixed by adding options.page to the page constructor. I pulled this fork & removed the lodash code and the tests still pass. Let me know if I can help get this fix into master. |
Curious if there is any concerns holding this PR from merging. I noticed some tests jQuery-ui was doing that could benefit from the ability to extend viewportSize as well. Their dialog tests are disabled in grunt/phantomjs I'm guessing in part because these won't pass.. |
Fwiw, I made a couple minor mods to this pull request in my branch here. bdowling@1593476 |
I noticed some unit tests were disabled in phantomjs. dialog and draggable depend on a larger viewPort. tooltip just seemed to work, so I reenebaled that as well. Changing the viewportSize depends on a not yet merged feature in gruntjs/grunt-lib-phantomjs#21
Note, this depends on the new phantomjs/main.js in the not yet merged feature in gruntjs/grunt-lib-phantomjs#21
Merged in from STRML/grunt-lib-phantomjs@e356ada (Essentially merged and squashed commits of gruntjs#21 and gruntjs#47 together)
Closing in favor of #21, which improves on this. |
I noticed some unit tests were disabled in phantomjs. dialog and draggable depend on a larger viewPort. tooltip just seemed to work, so I reenebaled that as well. Changing the viewportSize depends on a not yet merged feature in gruntjs/grunt-lib-phantomjs#21
Note, this depends on the new phantomjs/main.js in the not yet merged feature in gruntjs/grunt-lib-phantomjs#21
Yo,
I added an option to add custom headers to phantomjs.
Additionally I added:
expressjs
server to bounce headers).Gruntfile.js
to print debug info. (Not required, just useful.)README.md