Bilibili selectable danmu comments

Learning Chinese blazing fastly.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Bilibili selectable danmu comments
// @name:ja      Bilibili選択可能弾幕コメント
// @license      BSD 3-Clause License 

// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Learning Chinese blazing fastly.
// @description:ja  Learning Chinese blazing fastly.
// @author       You
// @match        https://www.bilibili.com/video/*

// @require      https://unpkg.com/[email protected]/dist/url-parse.js

// @run-at       document-idle
// @noframes
// ==/UserScript==

(async function()
{
    const sleep = m => new Promise(r => setTimeout(r, m));
    await sleep(200);
    while (true) {
        await sleep(200); // mseconds
        document.querySelector('div[class="bilibili-player-video-danmaku"]').style.zIndex = 69;
        document.querySelectorAll('div[class="b-danmaku"]').forEach(a => {
            a.style.userSelect = "text";
            a.style.pointerEvents = "all";
            a.style.cursor = "text";
        })
    }
})();