4

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

We do facebook login using hello.js

It seems that it is having issues accessing replaceState, and:

  • only happens in safari, desktop and mobile (9.0 and 9.1)
  • happens a few days, then stops for weeks, then comes back

I haven't been able to reproduce it, we have clientside error reporting where I see these errors bursts come and go.

Question is, has anyone experienced and solved this?

Felipe Pereira
  • 11,410
  • 4
  • 41
  • 45

3 Answers3

1

We've been experiencing this over the last few days with replaceState in JQuery mobile.

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

Summary

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

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

Response from Apple:

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

Resolution

For us the solution was simply to remove the offending line from the JQuery mobile framework:

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

I appreciate that this is probably not helpful to your case but at least it might help explain the behaviour you're seeing.

lathonez
  • 2,313
  • 1
  • 9
  • 12
0

No known solution (other than update) yet.

WebKit bug tracker:

PouchDB GH Issue:

Wulf Solter
  • 717
  • 6
  • 19
  • those bugs doesn't look related to `replaceState`, instead they mention browser db issues, but, I could be failing to see the connection – Felipe Pereira Apr 13 '16 at 00:23
  • Agreed. I'm intermittently getting a `SecurityError: DOM Exception 18` from jQuery... more digging is needed. – Wulf Solter Apr 14 '16 at 03:20
0

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

Wulf Solter
  • 717
  • 6
  • 19