Skip to content

Instantly share code, notes, and snippets.

@eiiot
Created October 1, 2023 15:33
Show Gist options
  • Save eiiot/36c2327f4521385ac34aceed8d43dc52 to your computer and use it in GitHub Desktop.
Save eiiot/36c2327f4521385ac34aceed8d43dc52 to your computer and use it in GitHub Desktop.
Add Tabroom.com Page Titles
// ==UserScript==
// @name Tabroom Headings
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds a button to cengage to scroll to the first assignment that's not completed already.
// @author You
// @match https://www.tabroom.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tabroom.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const h1 = document.querySelector("h1");
if (h1) {
document.title = h1.textContent;
} else {
const h2 = document.querySelector("h2");
if (h2) {
document.title = h2.textContent;
} else {
const h3 = document.querySelector("h3");
if (h3) {
document.title = h3.textContent;
} else {
const h4 = document.querySelector("h4");
if (h4) {
document.title = h4.textContent;
} else {
const h5 = document.querySelector("h5");
if (h5) {
document.title = h5.textContent;
} else {
const h6 = document.querySelector("h6");
if (h6) {
document.title = h6.textContent;
}
}
}
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment