Skip to content

Instantly share code, notes, and snippets.

@nathanpc
Created April 19, 2024 08:31
Show Gist options
  • Save nathanpc/7034be31cdb81cad63da3892ca29419f to your computer and use it in GitHub Desktop.
Save nathanpc/7034be31cdb81cad63da3892ca29419f to your computer and use it in GitHub Desktop.
A UserScript to clean up the GPS Power forum pages
// ==UserScript==
// @name Clean-GPS-Power
// @description Removes all of the garbage that is in the GPS Power forum pages.
// @match https://www.gpspower.net/*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
/**
* Deletes an element from the page if it is found.
*
* @param selector Query selector for the element to be deleted.
*/
function deleteIfFound(selector) {
const elems = document.querySelectorAll(selector);
for (const elem of elems) {
elem.remove();
}
}
// Clean things up!
deleteIfFound("[id*='ezoic']");
deleteIfFound("[class*='ezoic']");
waitForKeyElements("[data-ezoic-video-excluded]", () => {
deleteIfFound("[data-ezoic-video-excluded]");
});
waitForKeyElements("[class*='humix']", () => {
deleteIfFound("[class*='humix']");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment