如何用chrome在电脑上模拟微信内置浏览器


有些网页只能在微信里访问,复制链接后在电脑上访问就被跳转到别的页面去了。
如何用chrome在电脑上模拟微信内置浏览器?
有人做成功过嘛?
百度了下改userAgent好像不行。

chrome 微信 php html5

lloyd 9 years, 2 months ago

应该不行,如果用jssdk的话,他应该是调用了微信浏览器私有的API来判断的是否是微信,但是chrome中是没有这些API的。

快来造作啊 answered 9 years, 2 months ago

修改ua的方法好像不行,网页可能是通过jssdk判断的。
有没有办法或插件 禁止网页自动跳转的?

强势D废材 answered 9 years, 2 months ago

微信调试

不知道这个是否符合你的要求

八重雾中渡 answered 9 years, 2 months ago

大部分页面是判断UA来的, 但也有一部分页面是通过调用微信JS-SDK提供的方法,如果调用失败说明不在微信浏览器环境内,你可以尝试一下mock这些API

喝茶的灵梦 answered 9 years, 2 months ago


 微信安卓UA
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
微信iPhone UA
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
JS判断是否微信浏览器
function isWeixinBrowser(){
    var ua = navigator.userAgent.toLowerCase();
    return (/micromessenger/.test(ua)) ? true : false ;
}

如何修改chrome 的 ua
1、利用脚本修改
http://www.zimohan.com/wldd/78.html
2、利用chrome扩展
http://archives.guao.hk/posts/chrome-extension-chromeleon-user-agent-spoofer.html

微信内置ua
http://dearb.me/archive/2013-10-30/weixin-browser-user-agent/

七夜D战车 answered 9 years, 2 months ago

Your Answer