1.用瀏覽器模擬各類User Agenthtml
測試頁面的時候常常須要不一樣的User Agent,Firefox、Chrome瀏覽器就能夠完美的模擬出各類User Agent。User Agent Switch 這個插件就能夠幫上大忙,chrome和firefox都有這個插件。
先安裝User-Agent Switcher插件,而後點選項,在Custom User-Agent List里加入各類User Agent 。
好比 iPad:
iPhone 3.0
Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16
Apple Computer, Inc.
ipad
還有一種方法,WINDOWS電腦安裝有chrome的話,只要 「開始-運行」這些就OK。
谷歌Android:
chrome.exe –user-agent=」Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1″
蘋果iPhone:
chrome.exe –user-agent=」Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10″
蘋果iPad:
chrome.exe –user-agent=」Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16″
諾基亞N97:
chrome.exe –user-agent=」Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124″
其餘各類手機各類瀏覽器的User Agent見這裏:
http://www.zytrax.com/tech/web/mobile_ids.htmles6