-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Executing script causes Permission denied to access property "toString" on some sites #389
Comments
Checked Nightly 53.0a1 (2016-12-09) (64-bit) as well and it happens there too |
I spent quite a lot of time digging into this, and it appears that because your site has syntax errors that causes the document to be unloaded. The site tries to access the unload handler that Marionette registers on the sandbox. Because this sandbox is created in a privileged JS scope, accessing it will cause the |
I’m not entirely sure how the unload handler registered by Marionette is being accessed yet. The document you are navigating to is very complex and it would help to have a reduced and minimised test case. |
A syntax error causing the document to be unloaded sounds super-odd. In other news, thank you for the excellent bug report. |
This seems to reproduce it: def test_access_unload_handler(self):
self.marionette.navigate(inline("""
<script>
window.addEventListener = (type, handler) => handler.toString();
</script>"""))
self.marionette.execute_script("", sandbox=None) I’m not sure about the syntax error triggering this, but there is a lot of wonky error catching behaviour in the document. In any case, the syntax error is not relevant to the error that Marionette produces. |
We can fix this by ensuring any complex objects assigned to content are cloned, but I wonder if there are other ways to attach event handlers to the content window directly from the system privileged context, bypassing modifications to the window. |
Filed bug 1322862. |
Awesome! Excited to see the quick progress on this! Thanks! |
I have checked that this is now working (on my machine ;) ) with geckodriver 0.13 and Firefox 52 beta version 52.0b7 (32-bit). Thanks so much for your work on it! |
@BertLamb Great to hear it! |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue. |
Firefox Version: 50.0.2
Gecko Driver Version: 0.11.1 x64
Selenium .NET Libs 3.0.1
Platform: Windows 10
In working to upgrade our environment to the latest FF and therefore the new GeckoDriver we came across a weird issue with one website. Any attempt to call
ExecuteScript
will fail with aSystem.InvalidOperationException: Permission denied to access property "toString"
exception. Didn't happen with the old FirefoxDriver and FF 47, and doesn't happen on IE or Chrome.Hoping for some insight from y'all as to what is going on.
Steps to reproduce
Gecko Trace Log
The text was updated successfully, but these errors were encountered: