Created
April 21, 2010 22:03
-
-
Save cappuccino/374461 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# replaces the Chrome executable with a script which calls the original executable with the -allow-file-access-from-files argument. | |
# pass the path to the Chrome executable as the first argument. | |
original_path="$1" | |
base="$(basename "$original_path")" | |
new_path="$(dirname "$original_path")/$base-bin" | |
if [ ! -f "$original_path" ] || [ ! -x "$original_path" ]; then | |
echo "not an executable" | |
exit 1 | |
fi | |
if [ -f "$new_path" ]; then | |
echo "already patched" | |
exit 1 | |
fi | |
mv "$original_path" "$new_path" | |
echo '#!/bin/bash' > "$original_path" | |
echo "exec \"\${0%/*}/$base-bin\" -allow-file-access-from-files \"\$@\"" >> "$original_path" | |
chmod +x "$original_path" |
Thanks Tom, this is VERY helpful....
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only tested on OS X, might work on Linux though.
Relevant Chrome issue: http://code.google.com/p/chromium/issues/detail?id=37586