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
  • 62,215
  • 21
  • 143
  • 153
Tamás Bolvári
  • 2,530
  • 3
  • 28
  • 49

2 Answers2

4

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

You should avoid file:// entirely.

SLaks
  • 800,742
  • 167
  • 1,811
  • 1,896
0

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

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

Community
  • 1
  • 1
Tamás Bolvári
  • 2,530
  • 3
  • 28
  • 49