Skip to content

Instantly share code, notes, and snippets.

@Vashy
Created January 14, 2021 20:50
Show Gist options
  • Save Vashy/776038624079bc27b59ae38258354a15 to your computer and use it in GitHub Desktop.
Save Vashy/776038624079bc27b59ae38258354a15 to your computer and use it in GitHub Desktop.
D20pfsrd Popups Autoremover
// ==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