Strudels

NC News Pop-up Blockinator

Dec 9th, 2025 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         NC News Pop-up Blockinator
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2025-09-16
  5. // @description  Block stupid news pop-ups for NC/Premium stuff. May also block actual news pop-ups but there's not usually much of that. The home page is excluded.
  6. // @author       Rippy
  7. // @match        http*://*.neopets.com/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=neopets.com
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     const newsPopup = document.getElementById("news_popup");
  14.     if (newsPopup && !window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/home/)) {
  15.         const newsTitle = newsPopup.getAttribute("title");
  16.         newsPopup.remove();
  17.         document.getElementById("navpopupshade__2020").remove();
  18.  
  19.         setTimeout(() => { // recreate navpopupshade and trigger togglePopup in case there are other popups on the page that the player wants to use
  20.             const shade = document.createElement("div");
  21.             shade.id = "navpopupshade__2020";
  22.             shade.className = "nav-popup-shade__2020";
  23.             shade.setAttribute("onclick", "togglePopup__2020(this)");
  24.             shade.style.display = "none";
  25.             document.body.appendChild(shade);
  26.         }, 1000);
  27.         console.log("Removed news pop-up: " + newsTitle);
  28.     }
  29. })();
Advertisement
Add Comment
Please, Sign In to add comment