Chrome SecurityError loading jQuery Mobile page from local file system

I get the following error in Chrome when loading a trivially simple html file using jQuery Mobile link. The error is missing using only jQuery help.

Uncaught SecurityError: Failed to execute 'replaceState' in 'History': A history state object with the URL ' http://stacksnippets.net/js ' cannot be created in a document with the original value "null".

<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
</head>
<body></body>
</html>
Run codeHide result

You can also “Run the code snippet” and see the error in the console.

This mistake has not been until today. I have not changed my code or the way to upload the html file to the browser. It worked perfectly - I use the same code for all my PhoneGap applications.

- , Chrome, SecurityError, - ? ? .

UPDATE

, , , , , -: null Access-Control -Allow-Origin.

, , Chrome , - PhoneGap.

+4
4

, null. - Chrome. .

:

  • Chrome .
  • .
  • "".
  • Target, "-allow-file-access-from-files" .
  • .
  • .

, . .

.. , cordova .

+4

: history.replaceState jquery mobile, .

, Chrome .

+2

, , , Chrome (45) Dev (47).

CORS. , , crbug.com, Chrome .

0

Source: https://habr.com/ru/post/1605844/


All Articles