Greasy Fork is available in English.

mastalk.user.js

Mastodonのトゥートを音声読み上げ

Tämä skripti on poistettu.

// ==UserScript==
// @name             mastalk.user.js
// @name:en          mastalk.user.js
// @namespace        https://github.com/mominisjapan
// @version          0.1
// @description      Mastodonのトゥートを音声読み上げ
// @description:en   read aloud toots of local timeline of mastodon
// @author           Mominis
// @match            https://best-friends.chat/*
// @match            https://mstdn.jp/*
// @match            https://pawoo.net/*
// @match            https://mastodon.social/*
// @match            https://mastodon.cloud/*
// @grant            none
// @license          Unlicense
// ==/UserScript==

(() => {
    "use strict";
    const tootIdList = [];
    const doing = (first=document.querySelectorAll('.item-list article')[0]) => {
        console.log('doing...');
        const dtid = first.attributes["data-id"];
        if(tootIdList.includes(dtid)){
            setTimeout(() => doing(), 60)
        }else{
            console.log(tootIdList.push(dtid));
            tootIdList.push(dtid);
            speechSynthesis.speak((new SpeechSynthesisUtterance(document.querySelectorAll('.item-list article')[0].firstChild.firstChild.firstChild.children[2].firstChild.firstChild.data)));
            setTimeout(() => doing(), 60);
        }
    };
    window.addEventListener('load', () => {
        doing();
    });
})();