現在の位置
コレは何?
User Agent名(私はこういったブラウザを使っているんですよという部分)を偽装する拡張機能です。
UserAgentの表記は自己申告制なので、詐称することが出来ます。オンラインバンクなどでUserAgent名を見て「Firefoxはあかん!MSIEで出直してこい(#゚Д゚) ゴルァ」などと言われた場合は、一度この拡張を試してみるといいでしょう。
UserAgent名で制限を課しているページは少なくありません。ですが、自分で好きなようにUserAgent名を変えてしまえば、それらの制限は受けなくなります。具体的には(UserAgentによる振り分けを行っている)携帯だけの専用サイトに入ったり(UserAgentによる制限を課した)アクセス禁止ページに進入できます。
FAQ
履歴
DTD
useragentswitcher.dtd
<!-- Common --> <!ENTITY useragentswitcher.key gentswitcher.label "User Agent"> <!ENTITY useragentswitcher.name "User Agent Switcher"> <!-- About --> <!ENTITY useragentswitcher.about.author "作者"> <!ENTITY useragentswitcher.about.home.page "ホームページ"> <!ENTITY useragentswitcher.about.title "User Agent Switcer <!-- Menu --> <!ENTITY user.about.key "A"> <!ENTITY useragentswitche.about.label "User Agent Switcherについて"> <!ENTITY useragentswitcher.default.key "D"> <!ENTqqqITY useragentswitcher.default.label "標準"> <!ENTITY useragentswitcher.help.label "ヘルプ..."> <!ENTITY useragentswitcher.help.key "H"> <!ENTITY useragentswitcher.options.key "O"> <!ENTITY useragentswitcher.options.label "設定"> <!ENTITY useragentswitcher.options.menu.key "O"> <!ENTITY useragentswitcher.options.menu.label "設定..."> <!-- Options --> <!ENTITY useragentswitcher.app.name.label "名前:"> <!ENTITY useragentswitcher.app.version.label "バージョン:"> <!ENTITY useragentswitcher.description.label "見出し:"> <!ENTITY useragentswitcher.import.overwrite "インポートする時に既存のUser Agentを上書きする"> <!ENTITY useragentswitcher.menu.hide "User Agent Switcherのメニューを隠す"> <!ENTITY useragentswitcher.options.add "追加..."> <!ENTITY useragentswitcher.options.default.label "標準"> <!ENTITY useragentswitcher.options.delete "削除..."> <!ENTITY useragentswitcher.options.edit "編集..."> <!ENTITY useragentswitcher.options.export "エクスポート..."> <!ENTITY useragentswitcher.options.general.label "全般"> <!ENTITY useragentswitcher.options.import "インポート..."> <!ENTITY useragentswitcher.options.import.export "インポート/エクスポート"> <!ENTITY useragentswitcher.options.move.down "下へ移動"> <!ENTITY useragentswitcher.options.move.up "上へ移動"> <!ENTITY useragentswitcher.options.reset "設定をリセット..."> <!ENTITY useragentswitcher.options.title "User Agent Switcherの設定"> <!ENTITY useragentswitcher.options.user.agents.label "User Agents"> <!ENTITY useragentswitcher.options.view.default "標準の情報..."> <!ENTITY useragentswitcher.platform.label "プラットフォーム:"> <!ENTITY useragentswitcher.user.agent.label "User Agent:"> <!ENTITY useragentswitcher.vendor.label "Vendor:"> <!ENTITY useragentswitcher.vendor.sub.label "Vendor Sub:">
properties
useragentswitcher.properties
# Options useragentswitcher_addUserAgentTitle=User Agentの追加 useragentswitcher_defaultDescription=標準 useragentswitcher_defaultUserAgentTitle=標準のUser Agent useragentswitcher_deleteConfirmation=本当にこのUser Agentを削除しますか? useragentswitcher_editUserAgentTitle=User Agentの編集 useragentswitcher_emptyDescription=見出しが空欄です useragentswitcher_exportUserAgentsTitle=User Agentリストのエクスポート useragentswitcher_importFileFailed=ファイル %S は存在しないか、読み込み不可能です。 useragentswitcher_importParserError=ファイル %S は正しい形式ではありません。 useragentswitcher_importUserAgentsTitle=User Agentリストのインポート useragentswitcher_reset=リセット useragentswitcher_resetConfirmation=本当にUser Agent Switcherの全ての設定(User Agentリストも含む)をリセットしますか? useragentswitcher_resetConfirmationMessage=User Agent の一覧を含む、全ての設定をリセットします。よろしいですか? useragentswitcher_xmlFileDescription=XMLファイル # User Agents useragentswitcher_userAgentInternetExplorer=Internet Explorer 6 (Windows XP) useragentswitcher_userAgentNetscape=Netscape 4.8 (Windows XP) useragentswitcher_userAgentOpera=Opera 8 (Windows XP)
携帯端末機種判別CGI
#!/usr/local/bin/perl
#*****************機種判別CGIの例*****************
#このサンプルCGIでは
#WAP2.0ブラウザ搭載端末(3000/5000シリーズ)は、HTMLのトップページ
#HDMLブラウザ搭載端末(400/300シリーズなど)は、HDMLのトップページ
#その他の端末からは、HTMLの簡易ページが表示されます。
#**************************************************
#ユーザーエージェントを変数に取り込む
$u_a = $ENV{'HTTP_USER_AGENT'};
#*****************WAP2.0かどうかの判定*****************
#"UP.Browser"という文字列が先頭位置にあるかどうかを調べる
$up_pos=index($u_a, "UP.Browser");
if($up_pos == -1) {
#"UP.Browser"は見つからなかったので、PC/i-mode/J-SKY/etc.と判定
#EZweb以外へは、今回はユーザーエージェントを表示
$u_a_c = $u_a;
#そのままでは扱いにくいので、スラッシュを空白に置き換える
$u_a_c =~ s/\// /;
if($u_a_c =~ /^(\S+)/) {
#先頭の文字列を代入
$kaisya=$1;
} else {
#出力する文字列がない場合は、"不明"を代入
$kaisya="不明";
}
#PC/i-mode/J-SKY/etc.用にホームページを用意してください。
print "Content-type: text/html; charset=Shift_JIS\n\n";
print << "EOF";
<html>
<body>
[$kaisya]でアクセスしています。<br>
</body>
</html>
EOF
exit();
} elsif($up_pos == 0) {
#"UP.Browser"は先頭なので、HDMLブラウザ搭載機と判定
$lang_name="hdml";
} else {
#"UP.Browser"が文字列の途中に見つかったので、WAP2.0ブラウザ搭載機と判定
$lang_name="html";
}
#*****************対応するメッセージを表示*****************
if($lang_name eq "html") {
#WAP2.0ブラウザ搭載端末なので、HTMLを表示
print "Content-type: text/html; charset=Shift_JIS\n\n";
print<<"EOF";
<html>
<head>
<title>sample</title>
</head>
<body>
<table cellspacing="2">
<tr>
<th colspan="2" bgcolor="#ff9933">タイトル画像を入れる</th>
</tr>
<tr>
<th bgcolor="#ffff66">welcome to homepage!</th>
<th bgcolor="#99ccff"><a href="http://server/index.hdml">menuへ</a></th>
</tr>
</table>
</body>
</html>
EOF
} else {
#HDMLブラウザ搭載端末なので、HDMLを表示
print "Content-type: text/x-hdml; charset=Shift_JIS\n\n";
print<<"EOF";
<HDML VERSION=3.0 MARKABLE=TRUE>
<DISPLAY NAME=sample TITLE=sample>
<CENTER>タイトル画像を入れる<BR><BR>
<LINE>welcome to homepage!<WRAP>
<CENTER><A TASK=GOSUB DEST=http://server/index.hdml>menuへ</A><BR>\n";
</DISPLAY>
</HDML>
EOF
}
#終了
exit();