Greasy Fork

Greasy Fork is available in English.

多瑙影院去广告 & 增强

多瑙网站视频与网站广告去除,以及其他增强功能。

当前为 2017-02-03 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         多瑙影院去广告 & 增强
// @namespace    moe.jixun.dn-noad
// @version      1.1
// @description  多瑙网站视频与网站广告去除,以及其他增强功能。
// @author       Jixun Moe<https://jixun.moe/>
// @include      http://*.dnvod.eu/*
// @include      https://*.dnvod.eu/*
// @include      http://*.duonao.tv/*
// @include      https://*.duonao.tv/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

var each = [].forEach;

function remove (el) {
    if (el && el.parentNode) el.parentNode.removeChild(el);
}

function playNextEp () {
    let query = location.search.replace(/&.+/, '');
    let currentEp = document.querySelector('.bfan-n>a[href*="' + query + '"]');
    if (!currentEp) return ;

    let nextEp = currentEp.parentNode.parentNode.nextElementSibling;
    if (!nextEp) return ;

    nextEp = nextEp.querySelector('a');
    if (nextEp) nextEp.click();
}

function removePlayerLogo () {
    let ckstyle = window.ckstyle();
    ckstyle.logo = 'null';
    ckstyle.advmarquee = '';
    window.ckstyle = function () { return ckstyle; };
}

// Player AD removal.
if (window.PlayerConfig && window.PlayerConfig.desktopPlayer) {
    let p = window.PlayerConfig.desktopPlayer;
    p.l = p.r = p.d = p.u = p.pub_link = p.pub_surl = p.t = p.te = '';
    p.e = 6;
}

const ads = '#msg_winw, .clickbg, .r-gg, #box, .bfq-r, [class^="ggw-"], .tgg, #myaudient2, .footerwhole, .gg, .custom-contaienr';

addEventListener('DOMContentLoaded', function() {
    'use strict';

    var style = document.createElement('style');
    style.textContent = `
${ads} { display: none !important; }
.bfq { background: black; }
.bfq-l { width: calc(100% - 20px); }
#video > #a1 { text-align: center; }
`;
    document.head.appendChild(style);

    // delete all.
    each.call(document.querySelectorAll(ads), remove);

    // Remove player logo
    if (window.ckstyle) {
        removePlayerLogo();
    }

    // Auto play next ep.
    if (window.playerstop) {
        window.playerstop = playNextEp;
    }
});