您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Desktop Notifications for YourTurnMyTurn.com overview page when it is your turn
// ==UserScript== // @name Desktop Notifications for YourTurnMyTurn // @namespace ktaragorn // @include https://www.yourturnmyturn.com/status.php // @description Desktop Notifications for YourTurnMyTurn.com overview page when it is your turn // @version 6 // @grant none // ==/UserScript== function refresh() { if(!is_your_turn()){ console.log("refreshing") location.reload(); } } function is_your_turn(){ var search_for="It is not your turn right now." return ( document.documentElement.textContent || document.documentElement.innerText ).indexOf(search_for) === -1 } function notify(){ var notification = new Notification("Its your turn", { sticky: true, icon:"https://www.yourturnmyturn.com/favicon.ico", requireInteraction: true}) alert("Your turn") // stop gap fix until firefox fixes the requireinteraction feature } function setup_notifications() { // Let's check if the browser supports notifications if (!("Notification" in window)) { alert("This browser does not support desktop notification"); } // Otherwise, we need to ask the user for permission else if (Notification.permission !== "denied") { Notification.requestPermission(); } } $(function(){if(is_your_turn()) notify();}) setup_notifications() var refreshTime = 15; window.setTimeout(refresh,refreshTime * 1000);