您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
notificar quando o ASI terminar de gerar um relatorio.
// ==UserScript== // @name Alerta de Termo gerado // @namespace http://tampermonkey.net/ // @version 0.2 // @description notificar quando o ASI terminar de gerar um relatorio. // @author ils94 // @match https://asiweb.tre-rn.jus.br/asi/report?target=dry.infra.reports.web.UserReportsGateway&action=formUserReports // @grant none // ==/UserScript== (function() { 'use strict'; let audioPlayed = false; function playSound() { // Create an audio element let audio = new Audio('https://github.com/ils94/workoutTimer/raw/main/sound/finish_pt.mp3'); // Play the audio audio.play().then(() => { // Set audioPlayed to true after the audio is played audioPlayed = true; }).catch((error) => { console.error('Failed to play audio:', error); }); } function checkElement() { let element = document.querySelector('a[name="linkRelatFinalizado"]'); if (element && !audioPlayed) { console.log('Element found:', element); clearInterval(intervalId); playSound(); } else { console.log('Element not found, retrying in 3 seconds...'); } } let intervalId = setInterval(checkElement, 3000); // Add a click event listener to the document to allow audio playback document.addEventListener('click', () => { if (!audioPlayed) { playSound(); } }); })();