Knzk_singing

おにいさんがうたいます

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
    };
})();