The Guardian Nag Nullifier

Pay or consent or javascript

  1. // ==UserScript==
  2. // @name The Guardian Nag Nullifier
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-04-16
  5. // @description Pay or consent or javascript
  6. // @author bzly
  7. // @match https://www.theguardian.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=theguardian.com
  9. // @grant none
  10. // @license GPL-3.0-or-later
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function zap() {
  17. const popup = document.querySelector('[id^="sp_message_container_"]')
  18. const gate = document.querySelector('#sign-in-gate')
  19. if (popup) {
  20. console.log("Zapping pay or consent bullshit")
  21. popup.remove()
  22. document.querySelector('html').classList.remove('sp-message-open')
  23. }
  24. if (gate) {
  25. console.log("Zapping registration nag")
  26. gate.remove()
  27. }
  28. }
  29.  
  30. zap()
  31. const observer = new MutationObserver(zap)
  32. observer.observe(document, { childList: true, subtree: true })
  33. })();