Created
November 7, 2011 10:57
-
-
Save byroot/1344663 to your computer and use it in GitHub Desktop.
Shell helper for easy Facebook iframe debug in chrome (Mac OS only)
This file contains hidden or 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
| 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