Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 11.1 SecurityError (DOM Exception 18): Blocked attempt to use history.replaceState() to change session history URL

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.

like image 544
Alex Webster Avatar asked Nov 08 '22 14:11

Alex Webster


1 Answers

Please update following value in angular.js file.

OLD VALUE:

this.$$absUrl = appBaseNoFile + this.$$url.substr(1); 

NEW VALUE:

this.$$absUrl = appBaseNoFile + this.$$url;

ios11 gives error because of this: file:/// != file://

like image 140
ZAHEER BULEDI Avatar answered Nov 14 '22 21:11

ZAHEER BULEDI