niconico (X)

https://www.nicovideo.jp/video_top

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        niconico (X)
// @namespace   https://rinsuki.net/
// @match       https://twitter.com/*
// @match       https://mobile.twitter.com/*
// @grant       GM_addStyle
// @grant       GM_xmlhttpRequest
// @connect     https://nicovideo.cdn.nimg.jp/web/img/base/head/icon/nico/*.gif
// @version     1.0
// @author      rinsuki
// @license     MIT
// @description https://www.nicovideo.jp/video_top
// ==/UserScript==

GM_xmlhttpRequest({
  url: `https://nicovideo.cdn.nimg.jp/web/img/base/head/icon/nico/${Math.floor(Math.random() * 1000).toString(10).padStart(3, "0")}.gif`,
  responseType: "blob",
  onload: response => {
    console.log(response)
    GM_addStyle(`header h1 > a[href="/home"] > div { background-size: 30px; background-position: center; background-repeat: no-repeat; background-image: url(${URL.createObjectURL(response.response)}) }`)
  }
})

GM_addStyle(`
header h1 > a[href="/home"] > div > svg { opacity: 0; }
`)