您需要先安装一个扩展,例如 篡改猴、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.6 // @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 = 1; // عدد مرات التعديل المسموح بها 25، يمكنك تغيرها الى العدد الذي تريد window.onload = function(e){ addTohead(); var isCon = true; setInterval(function(){ var c = getRoot("@counter",0); var counter = parseInt(c.innerText); if (counter >= saveNow && isCon){ createAlert(); isCon = false; } if (counter == 0){ var alertFRM = getRoot("#connected"); if (alertFRM != null){ alertFRM.remove(); } isCon = true; } if (getRoot("@toolbar-button waze-icon-save ItemInactive",0) != undefined){ var BTNSave = getRoot("@toolbar-button waze-icon-save ItemInactive",0); if (BTNSave != undefined){ if (BTNSave != null){ BTNSave.setAttribute("id","SaveBTN"); } } if (BTNSave != null){ var mySave = getRoot("#SaveBTN"); var alertFRM = getRoot("#connected"); mySave.addEventListener("click",function(){ if (alertFRM != null){ alertFRM.remove(); } }); } } },100); } function createAlert(){ var URLLANG = window.location.href; createDiv(URLLANG.includes("ar")); try{ requestServer("https://www.waze.com/"); } catch(err) { if (div != null){ div.innerHTML = "<div align='center'>لا يوجد إتصال</div"; } } } function createDiv(lang){ if (lang == true){ if (getRoot("SaveBTN") == null){ var div = document.createElement("div"); div.id = "connected"; div.style.position = "absolute"; div.style.zIndex = 10000; div.style.top = "35px"; div.style.width = "200px"; div.style.height = "28px"; div.style.fontSize = "20px"; div.title = "إغلاق التنبيه"; div.style.borderRadius = "7px"; div.style.cursor = "pointer"; div.onclick = function(){ div.remove(); } div.onmouseover = function(){ div.style.color = "white"; div.style.textShadow = "1px 1px #B71C1C"; div.style.backgroundColor = "#EF5350"; } div.onmouseleave = function(){ div.style.color = "#212121"; div.style.textShadow = "1px 1px #9E9E9E"; div.style.backgroundColor = "#F5F5F5"; } div.style.right = "45%"; div.style.color = "#212121"; div.style.backgroundColor = "#F5F5F5"; div.style.boxShadow = "0px 3px #ab3232"; div.style.textShadow = "1px 1px #9E9E9E"; div.style.fontFamily = "'El Messiri', sans-serif"; div.innerHTML = "<div align='center'>قم بحفظ التعديلات</div"; document.getElementById("WazeMap").appendChild(div); } }else{ if (getRoot("SaveBTN") == 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.onmouseover = function(){ div.style.color = "white"; div.style.textShadow = "1px 1px #B71C1C"; div.style.backgroundColor = "#EF5350"; } div.onmouseleave = function(){ div.style.color = "#212121"; div.style.textShadow = "1px 1px #9E9E9E"; div.style.backgroundColor = "#F5F5F5"; } div.style.right = "45%"; div.style.color = "#212121"; div.style.backgroundColor = "#F5F5F5"; div.style.boxShadow = "0px 3px #ab3232"; div.style.textShadow = "1px 1px #9E9E9E"; div.style.fontFamily = "'Pontano Sans', sans-serif"; div.innerHTML = "<div align='center'>Save your edits</div"; document.getElementById("WazeMap").appendChild(div); } } } function requestServer(URL){ var getReguest = new XMLHttpRequest(); getReguest.open("GET",URL,false); getReguest.send(null); } function getRoot(name,index){ if (name != "" || name != null || name != undefined){ if (name.includes("@") && !name.includes("#")){ if (index != null || index != undefined){ var classname = name.replace("@",""); return document.getElementsByClassName(classname)[index]; }else{ var classname = name.replace("@",""); return document.getElementsByClassName(classname); } } else if (name.includes("#") && !name.includes("@")){ idname = name.replace("#",""); return document.getElementById(idname); } } } function addTohead(){ var linkAR = document.createElement("link"); linkAR.href = "https://fonts.googleapis.com/css?family=El+Messiri"; linkAR.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(linkAR); var linkEN = document.createElement("link"); linkEN.href = "https://fonts.googleapis.com/css?family=Pontano+Sans"; linkEN.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(linkEN); }