Skip to content

Instantly share code, notes, and snippets.

@byroot
Created November 7, 2011 10:57
Show Gist options
  • Select an option

  • Save byroot/1344663 to your computer and use it in GitHub Desktop.

Select an option

Save byroot/1344663 to your computer and use it in GitHub Desktop.
Shell helper for easy Facebook iframe debug in chrome (Mac OS only)
CHROME_BIN_DIR="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS"
CHROME_BIN_BAK="$CHROME_BIN_DIR/chrome.bin"
CHROME_BIN="$CHROME_BIN_DIR/Google Chrome"
function is_chrome_tweaked() {
/usr/bin/file -b "$CHROME_BIN" | grep -q ASCII || /usr/bin/file -b "$CHROME_BIN" | grep -q shell
}
function tweak_chrome() {
if is_chrome_tweaked ; then
echo "Chrome already tweaked"
return 1
fi
sudo mv "$CHROME_BIN" "$CHROME_BIN_BAK"
sudo cat << EOF > "$CHROME_BIN"
#!/bin/bash
"$CHROME_BIN_BAK" --disable-web-security --disable-extensions-http-throttling
EOF
sudo chmod +x "$CHROME_BIN"
}
function restore_chrome() {
if ! is_chrome_tweaked ; then
echo "Chrome not tweaked"
return 1
fi
sudo mv "$CHROME_BIN_BAK" "$CHROME_BIN"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment