0

I can't figure out how to fix this error, everytime I test my app on Google Chrome this error occurs, but the app works well in Firefox. What should I do to fix this?

Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///C:/Users/User/Desktop/finalproject/index.html' cannot be created in a document with origin 'null'.

Masoud
  • 8,020
  • 12
  • 62
  • 123
ryzen1226
  • 29
  • 1
  • 6
  • That's a security feature (same origin restriction) of chrome: [Origin null is not allowed by Access-Control-Allow-Origin](https://stackoverflow.com/questions/8456538/origin-null-is-not-allowed-by-access-control-allow-origin) The question isn't about `replacestate` but the underlying problem is the same – Andreas Oct 02 '15 at 06:14
  • what should i do to fix this? – ryzen1226 Oct 02 '15 at 06:15
  • it was working well on chrome a month ago, but now even my newly created apps produce the same error and only works on firefox – ryzen1226 Oct 02 '15 at 06:17
  • Read the linked question and the suggested answers :) – Andreas Oct 02 '15 at 06:17
  • Its working now, thank you so much for your help :) – ryzen1226 Oct 02 '15 at 06:39

1 Answers1

0

That's a security feature (same origin restriction) of chrome.

This question isn't about replacestate but the underlying problem is the same:
Origin null is not allowed by Access-Control-Allow-Origin

Andreas
  • 21,535
  • 7
  • 47
  • 56