问题描述
我正在使用Cordova和jQuery Mobile开发一个移动应用程序.我的应用程序在iOS 11.0.3上运行良好,然后在iOS 11.1出现时,出现错误,无法单击任何链接.我在野生动物园错误控制台中收到的错误是"SecurityError(DOM异常18):阻止尝试使用history.replaceState()更改会话历史URL."我添加了<meta http-equiv="Content-Security-Policy" content="default-src * data: blob: ws: wss: gap://ready file://*; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * ws: wss:;">
,因为我认为它可能是内容安全策略的一部分,但是我仍然收到相同的错误.我正在使用jQuery Mobile 1.4.5和jQuery 2.1.1.
I am developing a mobile app using Cordova and jQuery Mobile. My app was working fine for iOS 11.0.3 and then when iOS 11.1 came out, I am getting an error and unable to click on any links. The error I get in the safari error console is "SecurityError (DOM Exception 18): Blocked attempt to use history.replaceState() to change session history URL." I have added <meta http-equiv="Content-Security-Policy" content="default-src * data: blob: ws: wss: gap://ready file://*; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * ws: wss:;">
because I thought it might be part of the Content Security Policy but I am still receiving the same error. I am using jQuery Mobile 1.4.5 and jQuery 2.1.1.
推荐答案
请更新angular.js文件中的以下值.
Please update following value in angular.js file.
旧值:
this.$$absUrl = appBaseNoFile + this.$$url.substr(1);
新值:
this.$$absUrl = appBaseNoFile + this.$$url;
ios11由于以下原因给出错误:file:/// != file://
ios11 gives error because of this: file:/// != file://
这篇关于IOS 11.1 SecurityError(DOM异常18):阻止尝试使用history.replaceState()更改会话历史记录URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!