niconico (X)

https://www.nicovideo.jp/video_top

  1. // ==UserScript==
  2. // @name niconico (X)
  3. // @namespace https://rinsuki.net/
  4. // @match https://twitter.com/*
  5. // @match https://mobile.twitter.com/*
  6. // @grant GM_addStyle
  7. // @grant GM_xmlhttpRequest
  8. // @connect https://nicovideo.cdn.nimg.jp/web/img/base/head/icon/nico/*.gif
  9. // @version 1.0
  10. // @author rinsuki
  11. // @license MIT
  12. // @description https://www.nicovideo.jp/video_top
  13. // ==/UserScript==
  14.  
  15. GM_xmlhttpRequest({
  16. url: `https://nicovideo.cdn.nimg.jp/web/img/base/head/icon/nico/${Math.floor(Math.random() * 1000).toString(10).padStart(3, "0")}.gif`,
  17. responseType: "blob",
  18. onload: response => {
  19. console.log(response)
  20. 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)}) }`)
  21. }
  22. })
  23.  
  24. GM_addStyle(`
  25. header h1 > a[href="/home"] > div > svg { opacity: 0; }
  26. `)