facebook连接上的Intermitent SecurityError DOM Exception 18

错误是SecurityError:DOM Exception 18,它发生在replaceState @
https://connect.facebook.net/en_US/fbds.js第9行,pos 2343

我们使用hello.js登录facebook

它似乎遇到访问replaceState的问题,并且:

>仅在safari,桌面和移动设备(9.0和9.1)中发生
>发生几天,然后停止数周,然后回来

我无法重现它,我们有客户端错误报告,我看到这些错误爆发来来去去.

问题是,有没有人经历过并解决了这个问题?

最佳答案 在过去的几天里,我们一直在使用JQuery mobile中的replaceState.

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

摘要

一个简单的复制案例,它在Safari控制台中提供dom异常18:

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

来自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.

解析度

对我们来说,解决方案只是从JQuery移动框架中删除违规行:

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

我很欣赏这可能对你的情况没有帮助,但至少它可能有助于解释你所看到的行为.

点赞