Created
April 19, 2024 08:31
-
-
Save nathanpc/7034be31cdb81cad63da3892ca29419f to your computer and use it in GitHub Desktop.
A UserScript to clean up the GPS Power forum pages
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 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