RESOLVED LATER 154448
Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
https://bugs.webkit.org/show_bug.cgi?id=154448
Summary Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to b...
Henrik Hartz
Reported 2016-02-19 05:26:55 PST
------- Auto-generated details: Inspected URL: (unknown) Loading completed: false Frontend User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/602.1.20+ (KHTML, like Gecko) Uncaught exceptions: - SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent. (at Setting.js:61:44) - ReferenceError: Can't find variable: InspectorBackend (at InspectorBackendCommands.js:32:17) - ReferenceError: Can't find variable: InspectorBackend (at Main.js:59:25) ------- * STEPS TO REPRODUCE 1. What were you doing? Include setup or other preparations to reproduce the exception. - debugging a web view 2. Include explicit, accurate, and minimal steps taken. Do not include extraneous or irrelevant steps. - load a WKWebView instance in iOS simulator - use menu "Develop" -> "Simulator" -> "about: blank" (same result if the WKWebView has loaded content * NOTES Document any additional information that might be useful in resolving the problem, such as screen shots or other included attachments.
Attachments
Radar WebKit Bug Importer
Comment 1 2016-02-19 05:27:06 PST
Joseph Pecoraro
Comment 2 2016-02-19 09:41:01 PST
Hey! What version of the iOS did you see this on? What version of iOS is running in the iOS Simulator.
Henrik Hartz
Comment 3 2016-02-23 04:26:16 PST
(Sorry for the lag) This was observed using both 9.1 and 8.4 simulators, and a WKWebView prior to actual loading any content (as I need to debug some problems that happens as a HTML string is loaded in the WKWebView)
Henrik Hartz
Comment 4 2016-02-23 04:27:51 PST
addendum; I get the same error if I have loaded HTML content into the view and then attempt loading the web inspector.
Henrik Hartz
Comment 5 2016-02-23 04:35:38 PST
addendum #2; Here's a gist of a viewcontroller that reproduces the issue for me: https://gist.github.com/hhartz/3c5356919e8962b3f6be
Joseph Pecoraro
Comment 6 2016-03-17 20:54:43 PDT
Is this still happening? This sounds like a frontend issue (Safari, or WebKit Nightly). This sounds very similar to a recent bug that was fixed, Bug 155265.
Henrik Hartz
Comment 7 2016-03-18 01:05:08 PDT
Yes it's still happening with WebKit nightly, exact same exception messages logged. Can you suggest any additional steps that would help you identify/reproduce the issue?
Joseph Pecoraro
Comment 8 2016-03-24 11:52:00 PDT
(In reply to comment #7) > Yes it's still happening with WebKit nightly, exact same exception messages > logged. Can you suggest any additional steps that would help you > identify/reproduce the issue? Sorry for taking so long to reply. I was absolutely stumped. However, I think I stumbled across the problem! In Safari's Preferences > Privacy, do you have Cookies blocked? If you change the setting to "Allow from websites I visit" do things start working again?
Joseph Pecoraro
Comment 9 2016-03-24 11:53:16 PDT
> In Safari's Preferences > Privacy, do you have Cookies blocked? I should be clear, the label is "Cookies and website data" since here the issue is localStorage data, not really cookies.
Henrik Hartz
Comment 10 2016-03-26 08:26:46 PDT
That's it, works fine if cookies are enabled. Does that mean this setting has to be enabled for Safari debugging to work? At the very least it would be better to improve the error message, but if a user really wants to block cookies and local storage the simulator target could be greyed out or something similar to indicate it won't work.
Timothy Hatcher
Comment 11 2016-03-28 10:09:03 PDT
This is a bug. You should not need to change the cookie/storage setting to use Web Inspector. We will need to override the setting for our WebView. Thanks for testing this for us!
Timothy Hatcher
Comment 12 2016-03-28 10:10:59 PDT
*** Bug 155611 has been marked as a duplicate of this bug. ***
Timothy Hatcher
Comment 13 2016-04-26 10:52:28 PDT
*** Bug 156991 has been marked as a duplicate of this bug. ***
Joseph Pecoraro
Comment 14 2016-04-26 13:21:36 PDT
Given that this was an issue based on a Safari Preferences, this issue turned out to indeed be a Safari side issue and the fix would be there. The Safari issue is tracked by the radar created by this bug (<rdar://problem/24740414>). I'm going to close the bugzilla bug because there is no more action to be done in WebKit for this.
Note You need to log in before you can comment on or make changes to this bug.