浏览网页时,如何能把移动端网址自动转换成桌面端网址呢?

35 天前
 ShiJiashuai

我在 PC 端使用 chrome 浏览器配合 Google 搜索引擎时,靠前的搜索结果中,偶尔点开是移动端适配的网址。需要手动把网址前面的 m.去掉才能正常显示桌面端的渲染效果。可能是搜索引擎对移动端的优先展示。

举个例子,在 Google 搜索豆瓣时,第一个结果点开是 https://m.douban.com/movie/ 的网址,我需要手动把前面的 m.去掉以后才是正常的豆瓣页面。 类似的搜索还有 IT 桔子之类 https://m.itjuzi.com

只是一个很小的功能或者设置,有没有现有的浏览器脚本或者插件能解决我的这个需求呢?

感谢。

689 次点击
所在节点    问与答
4 条回复
yyzh
35 天前
google 傻 B 就是了.
YouMoeYi
35 天前
```js
// ==UserScript==
// @name Mobile to Web Redirect
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically redirect from mobile URLs to web page URLs
// @match http://*/*
// @match https://*/*
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Get the current URL
let currentURL = window.location.href;

// Check if the URL contains "m." or "mobile."
if (currentURL.includes("m.") || currentURL.includes("mobile.")) {
// Remove "m." or "mobile." from the URL
let webURL = currentURL.replace("m.", "").replace("mobile.", "");

// Redirect to the web page URL
window.location.href = webURL;
}
})();
```
Claude Opus 写的
7VO54YYGvw3LOF9U
34 天前
这样的网站也不是很多吧,可以把桌面版加书签,下次进去点那个书签进就行了
ShiJiashuai
34 天前
@YouMoeYi 感谢提供的方法,确实可以通过 AI 解决一些搜索无法解决的问题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1039913

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX