Knzk_singing

おにいさんがうたいます

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         Knzk_singing
// @namespace    https://github.com/yuzulabo
// @version      1.1.5
// @description  おにいさんがうたいます
// @author       neziri_wasabi (yuzu_1203)
// @match        https://knzk.me/*
// @match        https://friends.nico/*
// @license       MIT License
// ==/UserScript==

(function() {
    var audio_src  = Array();
    //これを足すとバリエーションが増えるよ
    audio_src[0] = "https://s3.mqube.net/t/files/item/file/201708/20170803218835/adcd0456.wav";
    audio_src[1] = "https://s3.mqube.net/t/files/item/file/201708/20170804623468/766aac33.wav";

    var audio_rand = Math.floor(Math.random()*audio_src.length);
    var nav = document.getElementsByClassName('drawer__inner');

    var audio_elem = document.createElement('audio');
    audio_elem.src = audio_src[audio_rand];
    audio_elem.setAttribute('style', 'width: 100%;');
    audio_elem.setAttribute('controlslist', 'nodownload');
    audio_elem.setAttribute('controls', '1');
    audio_elem.setAttribute('autoplay', '1');
    audio_elem.setAttribute('loop', '1');

    window.onload = function () {
        nav[0].appendChild(audio_elem);
    };
})();