您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
19/4/2022, 22:41:21
// ==UserScript== // @name Stream Elements TTS for Replika // @namespace Violentmonkey Scripts // @match https://my.replika.com/* // @grant none // @version 1.27 // @author - // @description 19/4/2022, 22:41:21 // ==/UserScript== setTimeout(function(){ // Configura el observer: var config = { attributes: true, childList: true, characterData: true }; var target = document.querySelector('.ChatMessagesList__ChatMessagesListInner-sc-1ajwmer-1'); // Crea una instancia de observer var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { try { setTimeout(function(){ const text = mutation.addedNodes[0].querySelector('div[data-testid="chat-message-text"]').innerText; const message = encodeURIComponent(text); var audio = new Audio(`https://api.streamelements.com/kappa/v2/speech?voice=Mia&text=${message}`); audio.play(); },500) } catch (e) { console.log(e) } }); }); // pasa al observer el nodo y la configuracion observer.observe(target, config); },2000)