Greasy Fork is available in English.
即时跳转所有百度贴吧跳转链接至主域名(大力飞砖版)
// ==UserScript==
// @name 献给安康
// @namespace https://github.com/yourname
// @version 2.1
// @description 即时跳转所有百度贴吧跳转链接至主域名(大力飞砖版)
// @author YXY
// @match *://jump.bdimg.com/*
// @match *://jump2.bdimg.com/*
// @match *://jump3.bdimg.com/*
// @run-at document-start
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
const domainMapper = {
getFullPath: () => window.location.href.split('.bdimg.com')[1] || '/',
buildTargetUrl: function() {
return 'https://tieba.baidu.com' + this.getFullPath()
},
// 执行即时跳转
execute: function() {
if (window.self === window.top) {
window.stop();
location.replace(this.buildTargetUrl());
}
}
}
domainMapper.execute();
})();