1
1

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.

OS X 版 Google Chrome の起動時に立ち上がるウインドウをシークレットモードに

Last updated at Posted at 2015-06-27

2015-07-04 追記

この方法では OS X 上での Selenium が正常に動作しなくなった。
また、 Chrome Secure Storage へのアクセス権の問題も発生することがわかった。

筆者はこの方法をやめ、また方法を模索中……。。


シークレットモード (Incoginito Window) は便利。
常にシークレットモードで立ち上がるようになると嬉しい。

次のような方針

  1. もしGoogle Chrome が起動しているなら停止する。
  2. Google Chrome.app/Contents/MacOS/Google Chrome を別の名前 (.orig) にして退避
  3. Google Chrome.app/Contents/MacOS/Google Chrome 自体はシェルスクリプトにする。
  4. シェルスクリプトの内容は --incognito オプションを付与して退避したオリジナルを起動するように書く。
  5. あとは通常通りの Google Chrome の起動 (アイコンをクリック, Spotlight, Launchpad ...)
Google_Chrome.app/Contents/MacOS/Google_Chrome
# !/usr/bin/env bash
cd "${0%/*}" && exec ./Google\ Chrome.orig --incognito
$ cd /Applications # Homebrew Cask で入れている場合は適当に調整必要
$ cd Google\ Chrome.app/Contents/MacOS
$ mv Google\ Chrome{,.orig}
$ cat <<'EOT'
# !/usr/bin/env bash
cd "${0%/*}" && exec ./Google\ Chrome.orig --incognito
EOT
$ chmod +x Google\ Chrome

今のところ良さそう。

免責

Google Chrome のアップデートによって動作に問題が生じないか等は、これから使っていくことで身を持って知る予定。
なので、シェル操作に慣れていて、自分で直せそうな方のみ自己責任でお試しください。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?