0

I have 2 files: file.html on my desktop, and local.html on my localhost. Is it possible to let the file access the localhost? Currently, I have this error on Chrome:

Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "http://localhost". The frame requesting access has a protocol of "file", the frame being accessed has a protocol of "http". Protocols must match.

A .htaccess solution is prefered, but Header set Access-Control-Allow-Origin * does not work.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Tamás Bolvári
  • 2,976
  • 6
  • 34
  • 57

2 Answers2

4

You can't do that. (except by bypassing policies entirely with JSONP)

You should avoid file:// entirely.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

Restart Chrome with the --disable-web-security flag.

Source: https://stackoverflow.com/a/3177718/1293492

Community
  • 1
  • 1
Tamás Bolvári
  • 2,976
  • 6
  • 34
  • 57