-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Unsafe JavaScript attempt to access frame in 1.9.8 #12697
Comments
The
|
+1 |
+1 |
2 similar comments
+1 |
+1 |
@vitallium : would you mind to ping CasperJs team when the issue is resolved ? Sorry to not help, I'm not very easy with C++, thank you for the great job you have done 👍 |
@mickaelandrieu yeah, sure. |
@mickaelandrieu fixed in #12720 |
a short example of this problem. If I copy and paste this code in the phantomjs "interpret"
I get this
|
We shouldn't change the URL of the main execution context. Because this will change security policy of our main frame which leads to the following message: `Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://bla.js. Domains, protocols and ports must match.` We can fix it by isolating main frame of PhantomJS execution context. We can destroy it separately. #12697
Fix in 1.9 branch (though it won't be part of any release). |
@ariya thanks. Am I correct considering this bug resolution ? Regards |
I don't think this bug applies to PhantomJS 2. But better double check and verify it. Not sure how critical it is for 1.9.8 to be excluded from CasperJS. Despite it's being annoying, the message is only a warning and AFAICS doesn't cause any functionality regression. Does the workaround with async |
The bug does break my use cases for CasperJS (where I'm managing scripts through stdio from another app, and since the message is submitted to stdout, not even stderr, it breaks havoc), and forced me to rollback to 1.9.7. As far as I'm concerned for my app, I agree with @mickaelandrieu, CasperJS simply does not work with PhantomJS 1.9.8. |
The CasperJS test suite is broken with 1.9.8 release of phantomjs but I will test the workaround. Thanks for your comment @jsotuyod |
This is a workaround for ariya/phantomjs#12697 which is also used in the guard-jasmine project DawidJanczak/guard-jasmine@04ca925
as suggested by some, I downgraded to phantomjs-1.9.7-15 but I still get the warnings. I'm running mocha with grunt and the grunt-mocha-phantomjs plugin |
I'm running into the same issue as @ekkis . Running the same set-up. After upgrading to latest versions of [email protected] and [email protected] also produces warnings. |
@hyprstack, if you're using the grunt-mocha-phantomjs plugin, I think the issue is that even though you may downgrade the version of phantomjs in your project, the plugin still uses the latest version. I have an open issue here: jdcataldo/grunt-mocha-phantomjs#47 to figure out how to get the plugin to downgrade |
@ekkis I am. However for the time being I've gone a created a grunt task to regex through the mocha.json file created and remove those lines. It works although I'm more concerned about why those messages are showing up in the first place. |
I don't find a |
@ekkis sorry, forgot to mention that my |
@hyprstack, jdcataldo looked into the issue and fixed it. you can uninstall/reinstall the grunt-mocha-phantomjs plugin and the warnings will be gone. it worked for me. |
@ekkis thanks for the head's up. I gave it a try but I'm still getting the error messages. Are you still using phantomjs-1.9.7-15? |
I should probably upgrade the module to grunt-mocha-phantomjs2.0.1!! |
Yep! Silly me. Forgot to update the version in my package.json. It's working now without logging those nasty messages. Cheers! 👍 |
oh. yes, the |
For casperJS folks, the WA mentioned in this thread worked for me:
|
Hello! You have a new message, please read http://magliner.eu/my.php?0b5m |
I see some questions on StackOverflow with
Unsafe JavaScript attempt to access frame
notices with the new PhantomJS version 1.9.8. I have created a small sample scriptThis didn't happen in 1.9.7.
Complete error
This is the smallest code that reproduces this for CasperJS (run as
casperjs test script.js
):I suspect this happens when PhantomJS tries to exit, but there is currently data exchange between page context and outer context. I've also searched for the error string in the sources here on github, but couldn't find any reference for this notice. The notices don't go way when PhantomJS is run with
--web-security=false
and similar.The text was updated successfully, but these errors were encountered: