V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
ShiJiashuai
V2EX  ›  问与答

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

  •  
  •   ShiJiashuai · 12 天前 · 557 次点击

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

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

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

    感谢。

    4 条回复    2024-05-12 20:38:21 +08:00
    yyzh
        1
    yyzh  
       12 天前 via Android
    google 傻 B 就是了.
    YouMoeYi
        2
    YouMoeYi  
       11 天前
    ```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
        3
    7VO54YYGvw3LOF9U  
       11 天前
    这样的网站也不是很多吧,可以把桌面版加书签,下次进去点那个书签进就行了
    ShiJiashuai
        4
    ShiJiashuai  
    OP
       11 天前
    @YouMoeYi 感谢提供的方法,确实可以通过 AI 解决一些搜索无法解决的问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1022 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 20:28 · PVG 04:28 · LAX 13:28 · JFK 16:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.