Intermitent SecurityError DOM Exception 18 on facebook connection

The error SecurityError: DOM Exception 18, and this happens on replaceState @ https://connect.facebook.net/en_US/fbds.js line 9, pos 2343

We are logging in to facebook with hello.js

It seems to be having problems accessing replaceStateand:

  • happens only in safari, on the desktop and on mobile devices (9.0 and 9.1).
  • occurs after a few days, then stops for several weeks, then returns

I could not reproduce it, we have reports on customer errors, where I see that these errors appear and go away.

The question is, did anyone experience and solve this?

+4
source share
3 answers

We have been observing this over the past few days with the replacement of State in a jQuery mobile device.

https://forums.developer.apple.com/thread/36650

Summary

A simple replication case that gives dom exception 18 in the Safari console:

for (var i=0 ; i<=100; i++) { window.history.replaceState(null, null, "http:/www.apple.com/"); }

Apple answer:

This issue behaves as intended based on the following: design. We fixed a security bug in iOS that abused PushState / replaceState.

Resolution

For us, the solution was simply to remove the violation string from the jQuery mobile platform:

window.history.replaceState( state, state.title || document.title, href );

I appreciate that this is probably not useful for your case, but at least it can help explain the behavior you see.

+1

Safari is set to block cookies (and other storage).

Settings> Safari> Block cookies> Always allow

See also: https://apple.stackexchange.com/questions/125584/broken-safari-dom-exception-18

0
source

All Articles