Greasy Fork

Greasy Fork is available in English.

Acfun Ad Helper

移动暂停广告并缩小至右下角,点击×关闭后不再显示

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Acfun Ad Helper
// @namespace    http://tampermonkey.net/
// @icon         https://tx-free-imgs.acfun.cn/content/2020_4_5/1.5860178587515075E9.png
// @version      0.23
// @description  移动暂停广告并缩小至右下角,点击×关闭后不再显示
// @author       zyl315
// @match        *://www.acfun.cn/v/*
// @exclude      *://www.acfun.cn/v/list**
// @require      http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    // Your code here...

    let timer = setInterval(function () {
        if ($('.pause-display').length == 0) {
            console.log("AcFun Ad Helper: Not find class 'pause-display'.");
        } else {
            move_pause_ad();
            close_pause_ad();
            window.clearInterval(timer);
            console.log('AcFun Ad Helper: Ad was moved.')
        }
    }, 1000);

    $(document).ready(function () {
        setTimeout(function () {
            window.clearInterval(timer);
        }, 8000);
    });
})();

function move_pause_ad() {
    let pause_ad = $('.pause-display')
    pause_ad.css({
        'position': 'absolute',
        'max-width': '15%',
        'min-width': '0',
        'bottom': '5%',
        'right': '1%'
    });
}
function close_pause_ad() {
    $('.close-icon').click(function () {
        $('.pause-display').css('display', 'none');
    });
}