Anonymous NextDNS

Remove NextDNS anonymous account expiration modal popup without registration

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Anonymous NextDNS
// @namespace   Violentmonkey Scripts
// @description Remove NextDNS anonymous account expiration modal popup without registration
// @match       *://my.nextdns.io/*
// @version     0.2.0
// @author      
// @require     https://cdn.jsdelivr.net/combine/npm/@violentmonkey/dom@1,npm/@violentmonkey/[email protected]
// @grant       GM_addStyle
// ==/UserScript==

(function () {
'use strict';

VM.observe(document.body, () => {
  // Find the target node
  const modalTitle = document.querySelector('.modal-title');

  if (modalTitle.textContent === "Expired") {
    // Remove modal
    const modal = document.querySelector(".modal");
    modal.remove();
    const modalBackdrop = document.querySelector(".modal-backdrop");
    modalBackdrop.remove(); // Remove hiding

    const root = document.querySelector("#root");
    root.setAttribute("aria-hidden", 'false');
    const body = document.querySelector("body");
    body.classList.remove("modal-open");
    body.style.overflow = "visible"; // disconnect observer

    return true;
  }
});

}());