0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WebツールのプラットホームとしてChromeを使いたいからCORSを無効にして起動する

0
Posted at

Chromeの起動オプションに--disable-web-securityを指定する

user-data-dirも合わせて指定し、設定ディレクトリも別にします。
例えば、Windows用にバッチファイルを作ると以下のようになります。

start chrome ./tools.html --disable-web-security --user-data-dir="./"

おわりに

APIを実行してみたいとき、例えば、curlを使ったりすると思います。
しかし、プログラマブルになにかしたいとき、Windowsだとcurlが標準で使えないし、Powershellもネットワーク処理がイマイチ…。

というわけで、選択肢の一つとしてブラウザを使ってちょっとしたGUIツールを作ったのですが、CORSに阻まれました。

というのが経緯です。

jQueryなどを使用すればOSにも依存しないし、HTML+Javascriptというのも使いやすくて良いと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?