您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
disconnect agent leg in nice
// ==UserScript== // @name disconnect agent leg // @description disconnect agent leg in nice // @license MIT // @namespace http://tampermonkey.net/ // @version 0.2 // @author You // @match https://max.niceincontact.com/index* // @grant none // ==/UserScript== (function() { 'use strict'; Notification.requestPermission(); setInterval( function() { checkLeg(); }, 7000); function checkLeg(){ if(document.getElementsByClassName("current-state")[0].innerHTML=="Unavailable") { var ellipsis = document.getElementsByClassName("status-text ellipsis"); console.log("checking status"); if(ellipsis[0].innerHTML!="Agent Leg - Inactive") { document.getElementsByClassName("toggle-leg-button")[1].click(); console.log("disconnecting"); setTimeout(function(){ if(ellipsis[0].innerHTML!="Agent Leg - Inactive") { console.log("Agent leg still inactive, reload with F5"); /*var notification = new Notification('refreshing', { body: "Refreshing page!", });*/ window.onbeforeunload = null; window.location.reload(); } }, 9000); //end set timeout //if(ellipsis[0].innerHTML!="Agent Leg - Inactive") { //location.reload(); //} } } } })();