Created
August 19, 2011 11:49
-
-
Save yosshi/1156641 to your computer and use it in GitHub Desktop.
User-agent を指定してGoogle Chromeを起動するシェルスクリプト(mac)
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 | |
# user agent | |
IPHONE='Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7' | |
XPERIA="Mozilla/5.0 (Linux; U; Android 1.6; ja-jp; SonyEricssonSO-01B Build/R1EA018) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1" | |
IS04="Mozilla/5.0 (Linux; U; Android 2.1-update1; ja-jp; IS04 Build/FEK100) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17" | |
ANDROID=$IS04 | |
EZWEB="KDDI-XX99 UP.Browser/6.2_7.2.7.1.K.8.400 (GUI) MMP/2.0" | |
GALAXY="Mozilla/5.0 (Linux; U; Android 2.3.3; ja-jp; SC-02B Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" | |
if [ "$1" == "iphone" ];then | |
UA=$IPHONE | |
elif [ "$1" == "android" ];then | |
UA=$ANDROID | |
elif [ "$1" == "is04" ];then | |
UA=$IS04 | |
elif [ "$1" == "ezweb" ];then | |
UA=$EZWEB | |
elif [ "$1" == "galaxy" ];then | |
UA=$GALAXY | |
else | |
UA=$IPHONE | |
fi | |
echo "UserAgent = $UA" | |
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-agent="$UA" 2> /dev/null & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ファイル名 chrome で保存して実行権限を与える。
実行方法
% chrome is04