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

WBOY
Release: 2016-06-06 20:37:44
Original
1614 people have browsed it

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

回复内容:

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

<code>微信安卓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 ;
}
</code>
Copy after login

如何修改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/

微信调试

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

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

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

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

伪造微信浏览器HTTP_USER_AGENT
http://www.dayecn.com/science/859_2.html
看看这篇文章

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!