Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name NC News Pop-up Blockinator
- // @namespace http://tampermonkey.net/
- // @version 2025-09-16
- // @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.
- // @author Rippy
- // @match http*://*.neopets.com/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=neopets.com
- // @grant none
- // ==/UserScript==
- (function() {
- const newsPopup = document.getElementById("news_popup");
- if (newsPopup && !window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/home/)) {
- const newsTitle = newsPopup.getAttribute("title");
- newsPopup.remove();
- document.getElementById("navpopupshade__2020").remove();
- setTimeout(() => { // recreate navpopupshade and trigger togglePopup in case there are other popups on the page that the player wants to use
- const shade = document.createElement("div");
- shade.id = "navpopupshade__2020";
- shade.className = "nav-popup-shade__2020";
- shade.setAttribute("onclick", "togglePopup__2020(this)");
- shade.style.display = "none";
- document.body.appendChild(shade);
- }, 1000);
- console.log("Removed news pop-up: " + newsTitle);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment