Skip to content

Instantly share code, notes, and snippets.

@Cj-Malone
Created June 29, 2025 13:02
Show Gist options
  • Select an option

  • Save Cj-Malone/ebb575544c5eae856a4d0f947cfe2524 to your computer and use it in GitHub Desktop.

Select an option

Save Cj-Malone/ebb575544c5eae856a4d0f947cfe2524 to your computer and use it in GitHub Desktop.
osm.mathmos.net Violentmonkey
// ==UserScript==
// @name New script - mathmos.net
// @namespace Violentmonkey Scripts
// @match https://osm.mathmos.net/chains/
// @match https://osm.mathmos.net/chains/*
// @grant none
// @version 1.0
// @author -
// @description 12/6/2023, 7:34:54 PM
// @require https://www.kryogenix.org/code/browser/sorttable/sorttable.js
// ==/UserScript==
if (document.URL == "https://osm.mathmos.net/chains/") {
table = document.getElementsByTagName("table")[0];
totalsRow = document.evaluate('tbody/tr[not(@class)][2]', table).iterateNext();
table.appendChild(document.createElement("tfoot"));
table.getElementsByTagName("tfoot")[0].appendChild(totalsRow);
}
for (td of document.getElementsByClassName("num")) {
if (td.textContent) {
td.setAttribute("sorttable_customkey", td.textContent.replace("m", ""));
}
}
for (table of document.getElementsByClassName("default")) {
sorttable.makeSortable(table);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment