Skip to content
Ibuki Sugiyama edited this page Jul 31, 2023 · 4 revisions

インストールできる既存のscript

随時追加予定。 増やしてくれてもええんやで…!

全ユーザーに猫耳を生やす
// ==UserScript==
// @name        Misskey Cat Paradise
// @version     0.1
// @description Nyaaaaaaa
// @author      @fuwa2003@misskey.io
// @match        https://misskey.io/*
// ==/UserScript==

window.addEventListener("load", function () {
  'use strict';
  const observerConfig = {
    childList: true,
    subtree: true
  };

  function observerCallback(mutationsList, observer) {
    for (let mutation of mutationsList) {
      if (mutation.type === 'childList') {
        const el = document.querySelectorAll('.x6tH3'); // Avatar
        el.forEach(e => {
          if (e.classList.contains('xyRmg')) return;
          e.classList.add('xyRmg');
          const ears = document.createElement('div');
          ears.classList.add('xbyxl');
          ears.innerHTML = '<div class="xhUxx"></div><div class="xudJZ"></div>';
          e.appendChild(ears);
        });
      }
    }
  }

  const observer = new MutationObserver(observerCallback);
  observer.observe(document.body, observerConfig);
});
ゲーミングモード(背景色を虹色にする)
(()=>{
  let x = 0;
  setInterval(()=>{
    window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'theme', value: `#000;rgb(${255*Math.max(0,Math.sin(x))}, ${255*Math.max(0,Math.sin(x+6.28/3))}, ${255*Math.max(0,Math.sin(x-6.28/3))})` }));
    x+=0.01;

  }, 10);
})();

サンプル

動作確認のためのサンプルです

文字色を赤に変える
window.addEventListener("MKReady", () => { document.getElementById("misskey_app").style.color = "red"; });

その他

GreasyForkで公開されているUserScript も動作するはずですが、 PC操作を前提としている可能性があることに注意してください。