-
-
Save hyper-neutrino/d3c4a1111fbf254721b1bd1a62ae71ef to your computer and use it in GitHub Desktop.
Transcript Redirect 0.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Transcript Redirect | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description replace room links with transcript links except the join button room and your already joined rooms | |
// @author You | |
// @match https://chat.stackexchange.com/* | |
// @icon https://www.google.com/s2/favicons?domain=stackexchange.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
setInterval(function() { | |
var exc = [...document.querySelectorAll("#my-rooms a, .room-name a")]; | |
[...document.querySelectorAll("a:not(#join-room)")] | |
.filter(a => !exc.includes(a)) | |
.filter(a => a.href.match(/https:\/\/chat\.stackexchange\.com\/rooms\/\d+/)) | |
.map(x => (x.href = "https://chat.stackexchange.com/transcript/" + x.href.substring(37))); | |
}, 100); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment