Help us understand the problem. What is going on with this article?

【Mac】Google Chromeでローカルファイル参照時のエラー回避

More than 5 years have passed since last update.

Google ChromeでJSONなどのローカルなデータを読み込もうとするとエラーが表示されます。

Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. 


open -a /Applications/Google\ --args -allow-file-access-from-files index.html


alias google_chrome_dev="open -a /Applications/Google\ --args -allow-file-access-from-files"

これで、$ google_chrome_devと起動するとエラーが出ない状態のChromeが立ち上がります。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away