Greasy Fork

Greasy Fork is available in English.

电脑浏览器中打开 m. 手机版网站时自动切换回 www. 电脑版网页

澎湃新闻,喜马拉雅,界面新闻,网易新闻,重定向.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         电脑浏览器中打开 m. 手机版网站时自动切换回 www. 电脑版网页
// @namespace    http://greasyfork.icu
// @version      1.0.0.8
// @include      *://m.*/*
// @grant        none
// @run-at       document-start
// @license      MIT
// @description 澎湃新闻,喜马拉雅,界面新闻,网易新闻,重定向.
// ==/UserScript==

(function() {
    'use strict';

    // Define a map of mobile to desktop hostnames
    const siteMap = {
        "m.thepaper.cn": "thepaper.cn",
        "m.huxiu.com": "huxiu.com",
        "m.jiemian.com": "jiemian.com",
        "m.ximalaya.com": "www.ximalaya.com",
        "m.dongqiudi.com":"www.dongqiudi.com",
        "m.163.com":"www.163.com",
        "m.stnn.cc":"www.stnn.cc",
        "m.douban.com":"www.douban.com",
        "m.gelonghui.com":"www.gelonghui.com",
        "m.jd.com":"www.jd.com",
        "m.18183.com":"www.18183.com"
    };

    // Check if the current hostname is in the siteMap and redirect if needed
    const desktopHostname = siteMap[location.hostname];
    if (desktopHostname) {
        location.replace(location.href.replace(location.hostname, desktopHostname));
    }
})();