您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
优化页面跳转链接
当前为
// ==UserScript== // @name ahhhhfs链接优化 // @namespace http://tampermonkey.net/ // @version 0.14 // @description 优化页面跳转链接 // @author silvio27 // @match https://*.ahhhhfs.com/* // @match https://nsfw.abskoop.com/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @license GPL // @grant none // ==/UserScript== (function () { 'use strict'; setTimeout(function () { // 移除 "转载请注明来源,本文来自:" document.oncopy = function () { console.log("Remove oncopy") } }, 500); // 移除 "转载请注明来源,本文来自:" window.onload = () => { document.oncopy = function () { console.log("Remove oncopy") } } var pp = document.getElementsByTagName('p') for (let i of pp) { let ss = i.innerText //如有需要合并下面两个判断 if (ss.includes('文字和括号')) { let cnPattern = /\(删掉文字和括号(复制到){0,1}浏览打开\)/ let newText = ss.replaceAll(cnPattern, '') addLinkInPage(i, newText) } // 默认自动删除 if (ss.includes('表情')) { let emojiReg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]|[\ud800-\udbff]|[\udc00-\udfff]/g; let newText = ss.replaceAll(emojiReg, '') addLinkInPage(i, newText, 1) } SetOpenLinkInSelf(i) } function addLinkInPage(html, text, autoClick = 0, color = 'gold') { html.innerHTML = text + '<br>' let temp_link = document.createElement("a"); let UrlPattern = /(http|magnet).+/ let hrefurl = text.match(UrlPattern) console.log(hrefurl[0]) temp_link.href = hrefurl[0]; temp_link.innerHTML = "点击:" + hrefurl[0]; temp_link.style.background = color html.appendChild(temp_link); if (autoClick) { temp_link.target = '_blank' temp_link.click() } } function SetOpenLinkInSelf(target) { let aTag = target.getElementsByTagName('a') for (let i of aTag) { i.target = '_self' } } // ===== Remove Unnecessary Element ===== function removeByClassName(className) { try { let item = document.getElementsByClassName(className) for (let i of item) { i.style.display = 'none' } } catch (err) { console.log(className + ':' + err.message) } return 'Done' } function removeById(idName) { try { let item = document.getElementById(idName) // item.style.display = 'none' item.remove() } catch (err) { console.log(idName + ':' + err.message) } return 'Done' } function removeParts(list, f) { for (let i of list) { f(i) } } let removeClassNames = ['site_abc_wrap top', 'site_abc_wrap bottum', 'sidebar-column', 'entry-navigation', 'related-posts', 'entry-share', 'footer-widget', 'footer-copyright', 'comment-respond', 'site-footer', 'ripro_gg_wrap', 'rollbar', 'module parallax', 'article-footer', 'article-copyright', 'related-posts-grid'] let removeIds = ['related_posts', 'jp-relatedposts'] removeParts(removeClassNames, removeByClassName); removeParts(removeIds, removeById); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址