素材牛VIP会员
如何模拟手机浏览器
 阴***光  分类:Html5  人气:1115  回帖:8  发布于6年前 收藏

如题,现在搞前端移动开发的是怎么模拟的,用几个FF插件或者Chrome插件吗?
有其它软件模拟不,请推荐几个插件,或者软件的,可能问的不对题,还希望理解

讨论这个帖子(8)垃圾回帖将一律封号处理……

Lv3 码奴
li***09 软件测试工程师 6年前#1

如果只是针对 responsive 页面模拟的话,可以像下面这样

Lv7 码师
to***09 PHP开发工程师 6年前#2

Responsive Design Trick

将以下内容添加至浏览器书签:

javascript:document.write('<!DOCTYPE html><html><head><meta charset="utf-8"><title>Responsive Design Testing</title><style>body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }.wrapper { width: 6000px; }.frame { float: left; }h2 { margin: 0 0 5px 0; }iframe { margin: 0 20px 20px 0; border: 1px solid #666; }</style></head><body><div class="wrapper"><div class="frame"><h2>240<span> x 320</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="240" height="320"></iframe></div><div class="frame"><h2>320<span> x 480</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="320" height="480"></iframe></div><div class="frame"><h2>480<span> x 640</span> <small>(small tablet)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="480" height="640"></iframe></div><div class="frame"><h2>768<span> x 1024</span> <small>(tablet - portrait)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="768" height="1024"></iframe></div><div class="frame"><h2>1024<span> x 768</span> <small>(tablet - landscape)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="1024" height="768"></iframe></div><div class="frame"><h2>1200<span> x 800</span> <small>(desktop)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="1200" height="800"></iframe></div></div></body></html>')

然后打开需要模拟的网页,点击这个书签,so easy。

UA Trick

安装这个Chrome Extension
https://chrome.google.com/webstore/detail/user-agent-switcheruserag/ighgcligfbemmpnidpkhikmnmeohfafb

Lv1 新人
闪***星 UI设计师 6年前#3

Chrome开发人员工具里面就有现在的设置选项,可以模拟手机浏览器的,或者帮我一起改进这个项目。 https://github.com/greatghoul/mobivie...

Lv5 码农
阿***7 产品经理 6年前#4

就其跟原来说就是更改浏览器向服务器发送的User Agent。

来个FireFox的: User Agent Switcher
https://addons.mozilla.org/en-US/fire...

Lv5 码农
陪***ˇ 产品经理 6年前#5

chrome 插件:User-Agent Switcher for Chrome

mac版safari:开发工具——用户代理

Lv4 码徒
青***e Linux系统工程师 6年前#6

Opera Mobile Emulator

http://www.opera.com/developer/tools/...

Lv3 码奴
贝***0 页面重构设计 6年前#7

想问LS画的图用什么软件搞定的。

Lv3 码奴
wj***37 页面重构设计 6年前#8

如果仅仅是简单的 responsive 页面模拟的话,Chrome 和 FF 就不需要装插件了。两者都能在审查元素里,找这个功能,可以模拟手机屏幕尺寸,改变页面显示大小。如图:

  1. Chrome 的是打开审查元素,点击右下角的齿轮设置,然后选择 Overrides,设置需要的屏幕尺寸即可。
  2. Firefox 的也一样是打开查看元素,不过直接在它右上角可以找到这个按钮。

其次,还有各种各样的在线测试工具:
http://www.leiphone.com/warlial-responsive-tool.html

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取