Greasy Fork

Greasy Fork is available in English.

虎扑手机版跳转网页版

虎扑手机版自动跳转网页版

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        虎扑手机版跳转网页版
// @namespace    https://wangtwothree.com/
// @version      0.2
// @description  虎扑手机版自动跳转网页版
// @author        wangtwothree
// @match        *://m.hupu.com/*
// @grant        none
// @license      MIT
// ==/UserScript==
(function() {
    // 获取当前页面 URL
    const currentUrl = window.location.href;
    if(currentUrl.includes('m.hupu.com')){
        // 提取 URL 中的数字部分
      const postId = currentUrl.match(/\/(\d+)\.html/)[1];
      // 新的 URL
      const newUrl = `https://bbs.hupu.com/${postId}.html`;
      // 页面跳转
      window.location.href = newUrl;
    }
})();