Configure Chrome to Automatically Load Mobile Versions of Web pages

时间:2015-07-28 16:23:54

标签: javascript google-chrome

I run Google Chrome on my full size laptop (Win 7), my cell phone (Android), and a rather small Dell netbook (Win XP). Certain sites will always open the full webpage on the laptop and a special mobile version on the cell phone.

Because the netbook screen is about the same shape as a large tablet, I would like to configure Chrome on the netbook to automatically call for the mobile version.

Can I get this result with some kind of script??

2 个答案:

答案 0 :(得分:1)

您可以使用navigator.userAgent属性,或只使用window.innerWidthwindow.innerHeight导航到指定大小或PPI密度的移动版本。

答案 1 :(得分:1)

如果您想要在每个页面中呈现平板电脑设备或其他相关尺寸,请使用Chrome控制台,请按以下步骤操作:

  1. 按F12,将打开Chrome控制台
  2. 按Ctrl + Shift + M,您将看到网格和页面渲染器作为页面左上角设置的默认大小,您可以更改大小或模拟设备