// ==UserScript== /*jshint esversion: 6 */ // @name 南+跳转自己域名对应的其他资源网站 // @namespace http://tampermonkey.net/dva // @version 1.0.5 // @description 针对不同域名的网站,替换成自己使用的域名再打开。 // @author Dva // @match *://*.south-plus.net/read.php?tid* // @match *://*.summer-plus.net/read.php?tid* // @match *://*.level-plus.net/read.php?tid* // @match *://*.south-plus.org/read.php?tid* // @match *://*.white-plus.net/read.php?tid* // @match *://*.imoutolove.me/read.php?tid* // @grant GM_setValue // @grant GM_getValue // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 把"hjd"冒号右边的双引号里替换成你用的2048域名,把"ch"冒号右边的双引号里替换成你用的村花地址,如果你使用的和我的一样则不用替换 const doms={ "hjd":"bs.qj0u.xyz", //2048网址 https://替换为中间这部分/2048/ "ch":"www.cunhua.guru", //村花网址 https://替换为中间这部分/thread/ }; const regs={ "hjd":"2048", "ch1":"cunhua", "ch2":"huo.wtf", } const re = /\d{4,}\d/g; let readTopic = document.getElementById("read_tpc"); let topicText = readTopic.textContent; let links = readTopic.getElementsByTagName("a"); if(links.length > 0){ let hasBasic = false; for(let l of links){ if(isBasic(l)){ hasBasic = true; } } if(hasBasic){ //添加打开全部链接的按钮 const topic = document.getElementById("subject_tpc").parentNode; const allBtn = document.createElement("button"); allBtn.style.marginLeft="5px"; allBtn.style.cursor = "pointer" allBtn.setAttribute("type","button"); allBtn.textContent="打开所有"; allBtn.onclick=function(){ openAll(links); } topic.appendChild(allBtn); //添加每个打开链接的按钮 for(let l=0;l