想到两个方案: 1. 纯前端 弄一个iframe,然后在里面覆写userAgent。 见http://stackoverflow.com/questions/14248446/setting-useragent-of-iframe-via-javascript 需要浏览器支持Object.defineProperty或Object.prototype.__defineGetter__ 2. 前后端 在后端curl(设置useragent为移动端的),填充在返回的页面中。
你需要一只chrome,按F12,左上角切换设备模型,shell窗口栏选Emulation,选择各种设备
