I want to request a new feature.
We all know, setInterval, setTimeout (can use as setinterval and repeat forever), AnimationFrame... can do something like good animation, clock, slide banner that change every 100-1xxxxx second depend on what developer want.
That feature is sometime helpful, but it cause a BIG problem, CPU intensive, and may waste user bandwidth for example they create XMLHttpRequest to refresh page HTML by request server HTML and then replace document.body.outerHTML with responseText from that XMLHttpRequest, that wast huge bandwidth, and that also help some site track you by sending http request on background every xxx second(s).
So it is possible for Palemoon Pause all kind of timer event if user switch tab ? There is probably no addon do such thing, unload tab type addon is overkill for this situation.
So I want to request you a about:config to prevent that from happening, there are user like me who don't want to be tracked, waste my BW, and waste my CPU cycle for suck thing.
An example to clear my request:
Code: Select all
function handleRequest(req) {
document.body.outerHTML = req.responseText;
//document.addEventListener("click", three);
//e.target.setAttribute("onclick", req.responseText );
//return req.responseText;
}
function sendRequest(url,callback,postData) {
var req = createXMLHTTPObject();
if (!req) return;
var method = (postData) ? "POST" : "GET";
req.open(method,url,true);
req.setRequestHeader('User-Agent','XMLHTTP/1.0');
if (postData)
req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
req.onreadystatechange = function () {
if (req.readyState != 4) return;
if (req.status != 200 && req.status != 304) {
// alert('HTTP error ' + req.status);
return;
}
callback(req);
}
if (req.readyState == 4) return;
req.send(postData);
}
var XMLHttpFactories = [
function () {return new XMLHttpRequest()},
function () {return new ActiveXObject("Msxml2.XMLHTTP")},
function () {return new ActiveXObject("Msxml3.XMLHTTP")},
function () {return new ActiveXObject("Microsoft.XMLHTTP")}
];
function createXMLHTTPObject() {
var xmlhttp = false;
for (var i=0;i<XMLHttpFactories.length;i++) {
try {
xmlhttp = XMLHttpFactories[i]();
}
catch (e) {
continue;
}
break;
}
return xmlhttp;
}
function autoreload() {
sendRequest(document.location.href, handleRequest);
}
window.setInterval(autoreload, "3000");
Thank!