您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
泥巴影视去广告(nbys/nivod)视频广告/图片广告;仅限PC/Mac/iPad端食用;
当前为
// ==UserScript== // @name 泥巴影视去广告(nbys/nivod) // @namespace http://tampermonkey.net/ // @version 0.1 // @license CC BY-NC-SA 4.0 // @description 泥巴影视去广告(nbys/nivod)视频广告/图片广告;仅限PC/Mac/iPad端食用; // @author limbopro // @match https://www.nivod4.tv/* // @icon https://www.google.com/s2/favicons?sz=64&domain=nivod4.tv // @grant none // @run-at document-body // ==/UserScript== // 一些常量 const imax = { css: { nbys: "#adsbox,.video-ad,#ad,img[src*=download],#adltop,.nav-ads,#adDiv {display:none !important}", // 泥巴影视视频左上角水印贴片 } } setConstant('detailParams.is_ad_play', 'false'); css_adsRemove(imax.css.nbys); // 动态创建引用内部资源 内嵌式样式 内嵌式脚本 function css_adsRemove(newstyle, delaytime, id) { setTimeout(() => { var creatcss = document.createElement("style"); creatcss.id = id; creatcss.innerHTML = newstyle; document.getElementsByTagName('head')[0].appendChild(creatcss) console.log("CSS样式新增完毕!"); }, delaytime); } /* 广告视频加速 */ function setConstant( chain = '', cValue = '' ) { if (typeof chain !== 'string') { return; } if (chain === '') { return; } const trappedProp = (() => { const pos = chain.lastIndexOf('.'); if (pos === -1) { return chain; } return chain.slice(pos + 1); })(); if (trappedProp === '') { return; } const thisScript = document.currentScript; const objectDefineProperty = Object.defineProperty.bind(Object); const cloakFunc = fn => { objectDefineProperty(fn, 'name', { value: trappedProp }); const proxy = new Proxy(fn, { defineProperty(target, prop) { if (prop !== 'toString') { return Reflect.deleteProperty(...arguments); } return true; }, deleteProperty(target, prop) { if (prop !== 'toString') { return Reflect.deleteProperty(...arguments); } return true; }, get(target, prop) { if (prop === 'toString') { return function () { return `function ${trappedProp}() { [native code] }`; }.bind(null); } return Reflect.get(...arguments); }, }); return proxy; }; if (cValue === 'undefined') { cValue = undefined; } else if (cValue === 'false') { cValue = false; } else if (cValue === 'true') { cValue = true; } else if (cValue === 'null') { cValue = null; } else if (cValue === "''") { cValue = ''; } else if (cValue === '[]') { cValue = []; } else if (cValue === '{}') { cValue = {}; } else if (cValue === 'noopFunc') { cValue = cloakFunc(function () { }); } else if (cValue === 'trueFunc') { cValue = cloakFunc(function () { return true; }); } else if (cValue === 'falseFunc') { cValue = cloakFunc(function () { return false; }); } else if (/^\d+$/.test(cValue)) { cValue = parseFloat(cValue); if (isNaN(cValue)) { return; } if (Math.abs(cValue) > 0x7FFF) { return; } } else { return; } let aborted = false; const mustAbort = function (v) { if (aborted) { return true; } aborted = (v !== undefined && v !== null) && (cValue !== undefined && cValue !== null) && (typeof v !== typeof cValue); return aborted; }; // https://github.com/uBlockOrigin/uBlock-issues/issues/156 // Support multiple trappers for the same property. const trapProp = function (owner, prop, configurable, handler) { if (handler.init(owner[prop]) === false) { return; } const odesc = Object.getOwnPropertyDescriptor(owner, prop); let prevGetter, prevSetter; if (odesc instanceof Object) { owner[prop] = cValue; if (odesc.get instanceof Function) { prevGetter = odesc.get; } if (odesc.set instanceof Function) { prevSetter = odesc.set; } } try { objectDefineProperty(owner, prop, { configurable, get() { if (prevGetter !== undefined) { prevGetter(); } return handler.getter(); // cValue }, set(a) { if (prevSetter !== undefined) { prevSetter(a); } handler.setter(a); } }); } catch (ex) { } }; const trapChain = function (owner, chain) { const pos = chain.indexOf('.'); if (pos === -1) { trapProp(owner, chain, false, { v: undefined, init: function (v) { if (mustAbort(v)) { return false; } this.v = v; return true; }, getter: function () { return document.currentScript === thisScript ? this.v : cValue; }, setter: function (a) { if (mustAbort(a) === false) { return; } cValue = a; } }); return; } const prop = chain.slice(0, pos); const v = owner[prop]; chain = chain.slice(pos + 1); if (v instanceof Object || typeof v === 'object' && v !== null) { trapChain(v, chain); return; } trapProp(owner, prop, true, { v: undefined, init: function (v) { this.v = v; return true; }, getter: function () { return this.v; }, setter: function (a) { this.v = a; if (a instanceof Object) { trapChain(a, chain); } } }); }; trapChain(window, chain); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址