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
  • 72,859
  • 23
  • 167
  • 174
Tamás Bolvári
  • 2,790
  • 4
  • 30
  • 55

2 Answers2

4

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

You should avoid file:// entirely.

SLaks
  • 837,282
  • 173
  • 1,862
  • 1,933
0

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

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

Community
  • 1
  • 1
Tamás Bolvári
  • 2,790
  • 4
  • 30
  • 55