Add this script to Tampermonkey to autoremove popups from d20pfsrd.
Created
January 14, 2021 20:50
-
-
Save Vashy/776038624079bc27b59ae38258354a15 to your computer and use it in GitHub Desktop.
D20pfsrd Popups Autoremover
This file contains hidden or 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 d20pfsrdPopupRemover | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove d20pfsrd popups | |
// @author You | |
// @include https://www.d20pfsrd.com/* | |
// @grant none | |
// ==/UserScript== | |
function removeElementsByClassName(className) { | |
const popup = document.getElementsByClassName(className); | |
for (const e of popup) { | |
if (e) e.remove(); | |
} | |
} | |
function clickById(id) { | |
const cookieConsentPopup = document.getElementById(id); | |
if (cookieConsentPopup) { cookieConsentPopup.click(); } | |
} | |
(function() { | |
'use strict'; | |
window.onload = () => { | |
removeElementsByClassName('ognannouncement-container active'); | |
clickById('cookieconsentno'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment