简体   繁体   English

如何在本地(通过扩展程序)请求网站的移动版本?

[英]How can I request mobile version of a site locally (from my extension)?

I'm developing an extension for Firefox and I wonder: Is there any way to see request mobile version of a site? 我正在为Firefox开发扩展程序,我想知道:有什么方法可以查看请求的网站移动版本? In Firefox for Android there is a menu item that let's you request the "desktop version" of a webpage. 在Android版Firefox中,有一个菜单项可让您请求网页的“桌面版”。 How can I do the reverse? 我该如何做相反的事情?

Thanks a lot, G. 非常感谢,G。

This really depends on each site's implementation of "mobile" detection. 这实际上取决于每个站点对“移动”检测的实现。 Some will be responsive based screen size (using media queries client-side) where you can minimize your window size to test. 有些将基于屏幕大小进行响应(使用客户端的媒体查询),您可以在其中最小化要测试的窗口大小。 Others will read the User Agent Header on the HTTP request coming into the server and serve up the mobile version. 其他人将阅读进入服务器的HTTP请求中的用户代理标题,并提供移动版本。 User Agent can be spoofed. 可以欺骗用户代理。 Google for a Search Engine Spoofer Firefox Plug-in and change it to a say IPhone User Agent for example Google搜索搜索引擎Spoofer Firefox插件,并将其更改为例如iPhone用户代理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以在抓取时阻止将我的请求重定向到移动网站吗? - Can I block redirecting my request to mobile site when crawling? 如何在Chrome扩展程序中本地保存信息? - How can I save information locally in my chrome extension? 如何通过移动版本向网站的桌面版本发出 AJAX 请求 - How to make a AJAX request to a Desktop version of a site via the Mobile version 如果在移动设备上查看脚本,如何禁用或隐藏脚本在我的网站上运行? - How can I disable or hide a script from running on my site if being viewed on a mobile device? 如何防止桌面版网站上的图片加载到移动设备上? - How can I prevent images that are on my desktop site from loading on mobile? 如何在我的站点中使用 jQuery 的 gzip 版本? - How can I use gzipped version of jQuery in my site? 如何在移动网站上创建“查看桌面版本”链接,而在解析后又不会循环回到移动版本? - How can I create a “view to desktop version” link on mobile site without it looping back to mobile version when it resolves? 我如何从inappbrowser cordova请求一个桌面站点 - how can I request a desktop site from inappbrowser cordova 如何禁用网站移动版本的脚本? - How do I disable the script for the mobile version of the site? 如何显示我网站的移动子菜单? - How can I reveal my site's sub-menu for mobile?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM