开发者

How to make your browser pretend it's a mobile phone?

开发者 https://www.devze.com 2023-02-21 06:05 出处:网络
I would really like to check out the source code of some website. They have a mobile detection script of some sort I guess, when you visit said开发者_如何学运维 website it redirects you to a mobile ve

I would really like to check out the source code of some website. They have a mobile detection script of some sort I guess, when you visit said开发者_如何学运维 website it redirects you to a mobile version (nope, entering the URL that they redirect me to in my browser doesn't work).

How can I pretend my computer is an iPhone or HTC or whatever?


Install this add-on for firefox which will let you change the user-agent string.

  • https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/


You may also like to try and OPEN the page in TEXT pad

Here is a simple version I did up for a client

http://www.baccus.net.au/m/index.php

NOTE that it strips the PHP and just leaves the HTML component

You can then SAVE AS html page and see what the page looks like.

You may need to do a BASE HREF to keep the full path and there are often problems with many CMS systems, but this will get you over the line quickly.

Hope this helps


if you are using PHP try this $_SERVER['HTTP_USER_AGENT'] you get phone company + model + browser info or os info !


The link in the accepted answer no longer exists. The recommended alternative currently:

https://addons.mozilla.org/en-GB/firefox/addon/user-agent-string-switcher/

0

精彩评论

暂无评论...
验证码 换一张
取 消