jm-remove-ad

JM漫画去广告

目前為 2025-06-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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())
// });