您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds 'Unread' link for each thread with new content, on the Active Topics index page
// ==UserScript== // @name Transit Forum Fixer // @namespace edzep.scripts // @version 1.0.4 // @author EdZep at HSX // @description Adds 'Unread' link for each thread with new content, on the Active Topics index page // @include http://*fordtransitusaforum.com/*active_topics // @grant GM_log // ==/UserScript== // Start (function() { 'use strict'; var findThreadLinks = document.evaluate("//a[@class='thread_title_link' and .//strong]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var threadCount = findThreadLinks.snapshotLength; //GM_log(threadCount); for(var i=0; i<threadCount; i++) { var target = findThreadLinks.snapshotItem(i); var targetURL = target.getAttribute("href"); var lastDot = targetURL.lastIndexOf('.'); var unreadURL = targetURL.substring(0,lastDot) + "-new-post.html"; target.outerHTML = target.outerHTML + " • <a href='" + unreadURL + "'>Unread</a>"; } })(); // End