keylol ad pointer/其乐轮播图广告指示器

受不了其乐在轮播图里插育碧的外链广告,做个指示器免得误点。

目前为 2023-09-15 提交的版本。查看 最新版本

// ==UserScript==
// @name         keylol ad pointer/其乐轮播图广告指示器
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  受不了其乐在轮播图里插育碧的外链广告,做个指示器免得误点。
// @description  point out the AD in keylol homepage slideshow.
// @author       [email protected]
// @match        https://keylol.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=keylol.com
// @grant        none
// @license      GPLv3
// ==/UserScript==

(function() {
    'use strict';
    document.styleSheets[document.styleSheets.length - 1].insertRule(
    `.ubi_warn {
        position: absolute;
        bottom: 1em;
        left: 0px;
        color: red;
        font-weight: bolder;
        font-size: 2em;
        margin-left: 1em;
    }`)
    Array.from(document.querySelectorAll('.slideshow a'))
        .filter(a_el => !a_el.href.includes('keylol.com'))
        .forEach(a_el => a_el.insertAdjacentHTML('afterend', '<span class="ubi_warn">广告</span>'))
})();