XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless)

前端 未结 9 793
醉梦人生
醉梦人生 2020-11-22 03:30

I\'m trying to create a website that can be downloaded and run locally by launching its index file.

All the files are local, no resources are used online.

Wh

9条回答
  •  遇见更好的自我
    2020-11-22 04:11

    Here is an applescript that will launch Chrome with the --allow-file-access-from-files switch turned on, for OSX/Chrome devs out there:

    set chromePath to POSIX path of "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"    
    set switch to " --allow-file-access-from-files"
    do shell script (quoted form of chromePath) & switch & " > /dev/null 2>&1 &"
    

提交回复
热议问题