Greasy Fork is available in English.
hides construction on Mi Drive other than total closures
当前为
// ==UserScript==
// @name Mi Drive - Total Closures Only
// @namespace vaindil
// @version 0.1
// @description hides construction on Mi Drive other than total closures
// @author vaindil
// @match http://mdotnetpublic.state.mi.us/drive/
// @grant none
// ==/UserScript==
console.log("(TC) beginning");
err_num = 0;
startcode = function() {
try {
if (document.getElementById('map_layers') !== null && document.getElementById('map_layers') !== "") {
//debugger;
console.log("(TC) start");
var elem = document.querySelectorAll('[*|href="images/bo_18px_.png"]');
var elemt = document.querySelectorAll('[*|href="images/bg_18px_.png"]');
for (var i = elem.length - 1; i >= 0; i--) {
elem[i].parentNode.removeChild(elem[i]);
}
for (var j = elemt.length - 1; j >= 0; j--) {
elemt[j].parentNode.removeChild(elemt[j]);
}
console.log("(TC) layers removed");
} else {
if (err_num == 9) {
alert("Mi Drive took too long to load, Total Closures can't run.");
console.log("(TC) too many errors, quitting");
return;
}
err_num++;
console.log("(TC) not loaded, pausing");
setTimeout(startcode, 3000);
}
} catch (err) {
if (err_num == 9) {
console.log("TC too many errors, quitting");
return;
}
console.log("TC error: "+err);
err_num++;
setTimeout(startcode, 3000);
}
};
startcode();