jm-remove-ad

JM漫画去广告

Stan na 21-06-2025. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        jm-remove-ad
// @namespace   Violentmonkey Scripts
// @match       https://18comic.vip/*
// @grant       GM_addStyle
// @version     1.0
// @author      mesimpler
// @require     https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// @description JM漫画去广告
// @description 2025/6/21 08:57:06
// ==/UserScript==

function applyToElement(selector, callback) {
  const element = document.querySelector(selector)
  if (element) callback(element);
}
function applyToAllElements(selector, callback) {
  const elements = document.querySelectorAll(selector);
  if(elements) {
     elements.forEach(callback)
  }
}

applyToElement('.div-bf-pv', (el) => el.remove())
applyToElement('.top-nav', (el) => el.remove())
applyToElement('#Comic_Top_Nav', (el) => el.style.top = 0)
applyToElement('img[src*="float-right-close.png"]', (el) => el.parentElement.remove())
applyToElement('div[class*="sticky"]', (el) => el.remove())

applyToAllElements('.meun-game', (el) => el.parentElement.remove())
applyToAllElements('.meun-video', (el) => el.parentElement.remove())

GM_addStyle(`
  .ph-bottom li {
    width: 100% !important;
  }
`)

setInterval(() => {
  applyToAllElements('div[data-show="ok"]', (el) => el.parentElement.parentElement.remove())
}, 3000)

// const targetNode = document.querySelector("#wrapper");
// const disconnect = VM.observe(targetNode, () => {
//   applyToAllElements('div[data-show="ok"]', (el) => el.parentElement.parentElement.remove())
// });