Skip to content
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

Need to pass --web-security=[true|false] to phantomjs #69

Closed
krawaller opened this issue Jan 22, 2015 · 4 comments
Closed

Need to pass --web-security=[true|false] to phantomjs #69

krawaller opened this issue Jan 22, 2015 · 4 comments

Comments

@krawaller
Copy link
Contributor

Hey!
I'm building an api module that is supposed to work both in node and in privileged browser environments such as PhoneGap/Cordova. It contains integration tests making cross-origin requests to a url that is not CORS-enabled. This is fine for my use-case since the XHR in PhoneGap/Cordova is not restricted by the same-origin policy.

These integration tests work with mocha (since node too can make cross-origin requests), but fail in mochify since it's not currently possible to pass the necessary --web-security=false flag into mochify and on to phantomic and phantomjs. Do you think we could add support for it somehow? If so, I can do the implementation, but we'd of course have to agree on a sane solution.

I guess we could either make some kind of subargs thingy that lets you specify arbitrary arguments to be passed on from mochify to phantomic and then on to phantomjs, or we could add an explicit --web-security flag to mochify and phantomic. Do you prefer any of them, or do you have any other ideas?

Thanks!

@krawaller
Copy link
Contributor Author

Oh, I realise this is very much related to #26

@mantoni
Copy link
Owner

mantoni commented Jan 23, 2015

It should be straight forward to add an explicit -- option for this. Use the phantomjs option name and just pass it through.

I gave up looking into a generic solution for options. You need to know which one affects which library, assign default etc...

Thanks!

@krawaller
Copy link
Contributor Author

@mantoni sweet!

I took a stab at it here for mochify and here for phantomic!

@mantoni
Copy link
Owner

mantoni commented Jan 27, 2015

Good work 👍

@mantoni mantoni closed this as completed Jan 27, 2015
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