Greasy Fork

AV_AD_Block

missav

目前为 2022-10-19 提交的版本。查看 最新版本

// ==UserScript==
// @name         AV_AD_Block
// @description  missav
// @icon         https://static.missav.com/img/favicon.png
// @namespace    loadingi.local
// @version      0.3
// @author       ch
// @match        https://missav.com/*
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_xmlhttpRequest
// @license      GPL-3.0-only
// ==/UserScript==

(function() {
    'use strict';
    console.log('running')
////missav.com
  //Block OnceClick PopUp
    var elem0 = document.querySelector("div.flex-1.order-first").children[0]
    elem0.removeAttribute('x-init')
    elem0.removeAttribute('x-data')
    var elem1 = document.querySelector("div.relative.-mx-4.-mt-6.sm\\:m-0").children[0]
    elem1.removeAttribute(elem1.attributes[0].name)
    elem1.removeAttribute('@click.once')
  //Block GIF AD
    document.querySelector('div.space-y-5.mb-5').remove()
    document.querySelector('div.under_player').remove()
  //Block Video AD
    var timerVar = setInterval (function() {blockvad(); }, 3000);
    function blockvad(){
        console.log('trying')
        var elem2 = document.querySelector("button[class^=close-button]")
        while(elem2){
            console.log('true')
            elem2.parentElement.remove()
            clearInterval (timerVar);
            timerVar= "";
        }
    }

    console.log('still running')

})();