您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
默认使用新标签打开v2ex,而不是在原有网页中打开
// ==UserScript== // @name v2ex 新标签打开 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 默认使用新标签打开v2ex,而不是在原有网页中打开 // @author [email protected] // @match https://www.v2ex.com/* // @license MIT // @grant none // ==/UserScript== function createProcess() { let timer = null; return () => { if (timer) { console.log('clearTimer') clearTimeout(timer) } timer = setTimeout(() => { const arr = Array.from(document.querySelectorAll('.topic-link:not([data-done])')) arr.forEach(anchor => { const href = anchor.getAttribute('href') if (!href) return; anchor.setAttribute anchor.setAttribute('target', '_blank') anchor.setAttribute('data-done', 1) }) }, 800) } } const process = createProcess() (function() { const answersDom = document.querySelector('#Main') if (!answersDom) { console.log('answer dom not exist!') return; } process() const observer = new MutationObserver(function() { console.log('observer worked') process() }); observer.observe(answersDom, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址