您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Check the connection, A tool to check your Internet connection
当前为
// ==UserScript== // @name Check the connection // @namespace https://www.waze.com/* // @version 0.4 // @description Check the connection, A tool to check your Internet connection // @author sultan alrefaei // @match https://www.waze.com/editor/ // @match https://www.waze.com/ar/editor/ // @match https://www.waze.com/editor // @match https://www.waze.com/ar/editor // @grant none // @copyright 2017 sultan alrefaei // ==/UserScript== var saveNow = 25; // عدد مرات التعديل المسموح بها 25، يمكنك تغيرها الى العدد الذي تريد window.onload = function(e){ var isCon = true; setInterval(function(){ if (document.getElementsByClassName("toolbar-button waze-icon-save ItemInactive")[0] != undefined){ if (document.getElementsByClassName("toolbar-button waze-icon-save ItemInactive")[0] != null){ document.getElementsByClassName("toolbar-button waze-icon-save ItemInactive")[0].setAttribute("id","SaveBTN"); } } if (document.getElementsByClassName("toolbar-button waze-icon-save ItemInactive")[0] != null){ document.getElementById("SaveBTN").addEventListener("click",function(){ if (document.getElementById("connected") != null){ document.getElementById("connected").remove(); } }); } var c = document.getElementsByClassName("counter"); var counter = parseInt(c[0].innerText); if (counter >= saveNow && isCon){ createAlert(); isCon = false; } if (counter == 0){ isCon = true; if (document.getElementById("connected") != null){ document.getElementById("connected").remove(); } } },100); } function createAlert(){ var URLLANG = window.location.href; if (URLLANG.includes("ar") == true){ if (document.getElementById("connected") == null){ var div = document.createElement("div"); div.id = "connected"; div.style.position = "absolute"; div.style.zIndex = 10000; div.style.top = "35px"; div.style.width = "150px"; div.style.height = "30px"; div.style.fontSize = "20px"; div.title = "إغلاق التنبيه"; div.style.borderRadius = "7px"; div.style.cursor = "pointer"; div.onclick = function(){ div.remove(); } div.style.right = "45%"; div.style.backgroundColor = "white"; div.style.boxShadow = "1px 1px #ab3232"; div.innerHTML = "<div align='center'>قم بحفظ التعديلات</div"; document.getElementById("WazeMap").appendChild(div); try{ requestServer("https://www.waze.com/"); } catch(err) { if (div != null){ div.innerHTML = "<div align='center'>لا يوجد إتصال</div"; } } } }else{ if (document.getElementById("connected") == null){ var div = document.createElement("div"); div.id = "connected"; div.style.position = "absolute"; div.style.zIndex = 10000; div.style.top = "35px"; div.style.width = "150px"; div.style.height = "30px"; div.style.fontSize = "20px"; div.title = "Close"; div.style.borderRadius = "7px"; div.style.cursor = "pointer"; div.onclick = function(){ div.remove(); } div.style.right = "45%"; div.style.backgroundColor = "white"; div.style.boxShadow = "1px 1px #ab3232"; div.innerHTML = "<div align='center'>Save your edits</div"; document.getElementById("WazeMap").appendChild(div); try{ requestServer("https://www.waze.com/"); } catch(err) { if (div !== null){ div.innerHTML = "<div align='center'>No connection</div"; } } } } } function requestServer(URL){ var getReguest = new XMLHttpRequest(); getReguest.open("GET",URL,false); getReguest.send(null); }