Last active
January 28, 2021 14:33
-
-
Save riyad/7553003 to your computer and use it in GitHub Desktop.
Open a Chrome window with a temporary profile and several security checks disabled.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de> | |
# License: Mozilla Public License 2.0 | |
# | |
# Loads an unsafe (i.e. with several security features disabled) instance of | |
# Chrome with a temporary profile (i.e. all data is lost once Chrome is closed) | |
chrome-unsafe() { | |
# for Homebrew Cask (see http://caskroom.io/) compatibility | |
local -a CHROME_PATHS | |
CHROME_PATHS=( \ | |
"/opt/homebrew-cask/Caskroom/google-chrome-dev/latest/Google Chrome.app/Contents/MacOS/Google Chrome" \ | |
"/opt/homebrew-cask/Caskroom/google-chrome/latest/Google Chrome.app/Contents/MacOS/Google Chrome" \ | |
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ | |
"chrome" \ | |
"chromium" \ | |
) | |
local CHROME="${CHROME_PATHS[1]}" | |
while [[ -n CHROME_PATHS ]] && ! type ${CHROME} > /dev/null; do | |
shift CHROME_PATHS | |
CHROME="${CHROME_PATHS[1]}" | |
done | |
local DATA_DIR="$(mktemp -d -t 'chrome-unsafe_data_dir.XXXXXXXXXX')" | |
# for a listing of command line switches see: | |
# https://peter.sh/experiments/chromium-command-line-switches/ | |
"${CHROME}" \ | |
--disable-bundled-ppapi-flash \ | |
--disable-popup-blocking \ | |
--disable-sync \ | |
--disable-web-security \ | |
--ignore-certificate-errors \ | |
--no-default-browser-check \ | |
--no-first-run \ | |
--non-secure \ | |
--user-data-dir="${DATA_DIR}" \ | |
$@ >/dev/null 2>&1 &! | |
# for now the window will not be brought to the front | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use oh my ZSH you can save this file in
~/.oh-my-zsh/custom/plugins/chrome-unsafe/chrome-unsafe.plugin.zsh
and addchrome-unsafe
to your list of used plugins in~/.zshrc