Skip to content

Instantly share code, notes, and snippets.

@hyper-neutrino
Last active May 10, 2021 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyper-neutrino/d3c4a1111fbf254721b1bd1a62ae71ef to your computer and use it in GitHub Desktop.
Save hyper-neutrino/d3c4a1111fbf254721b1bd1a62ae71ef to your computer and use it in GitHub Desktop.
Transcript Redirect 0.3
// ==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