NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name SimpleThreadOpen // @version 2 // @namespace http://www.fireblend.com/ // @updateURL https://openuserjs.org/meta/Fireblend/SimpleThreadOpen.meta.js // @downloadURL https://openuserjs.org/src/scripts/Fireblend/SimpleThreadOpen.user.js // @license MIT // @icon https://media.discordapp.net/attachments/165286383257255936/429860317649174529/imageedit__4571108207.png // @homepageURL http://www.fireblend.com/ // @author Sergio Morales // @description Make opening Era threads predictable! // @include http*://www.resetera.com/ // @include http*://www.resetera.com/* // @include http*://www.resetera.com/forums/* // @include http*://www.resetera.com/forums/*/* // @run-at document-idle // ==/UserScript== (function () { 'use strict'; function replaceTargets() { var anchors = [].slice.call(document.querySelectorAll('a')); anchors.forEach(function (element) { var currentTarget = element.href; if (currentTarget.endsWith("/unread")) { element.href = currentTarget.replace("/unread", ""); var a1 = makeLink(currentTarget); element.parentElement.insertBefore(a1, element); } }); } function makeLink(original_url) { var a = document.createElement('a'); a.setAttribute('style', 'cursor:pointer; font-size:13px;'); a.setAttribute('href', original_url); a.appendChild(document.createTextNode("📑 ")); return a; } replaceTargets(); })();