Greasy Fork is available in English.
手机虎扑,自动跳转网页版
当前为
// ==UserScript==
// @name 手机虎扑内容自动跳转网页版
// @version 0.2
// @description 手机虎扑,自动跳转网页版
// @author yann
// @match *://m.hupu.com/*
// @icon https://w1.hoopchina.com.cn/images/pc/old/favicon.ico
// @grant none
// @namespace http://tampermonkey.net/
// @license MIT
// ==/UserScript==
(function() {
'use strict';
var url = location.href;
// 使用正则表达式匹配两种格式
var pattern = /https:\/\/m\.hupu\.com\/(bbs-share|bbs)\/(\d+\.html)/;
var match = url.match(pattern);
if (match) {
// 如果匹配成功,构建新的 URL
var newUrl = `https://bbs.hupu.com/${match[2]}`;
location.href = newUrl;
} else {
console.log("URL 格式不匹配,无法转换");
}
})();