Discussões » Criação de Solicitações
[script request] Stop auto-reload of page
Googling it shows me there are addons and config tweaks for FF and extensions for Chrome.
Thanks, but that doesn't help me. The solutions there don't affect javascript, or if the proposed ones might work, require coding I'm not capable of. I can kill all javascript for a site, and that would work, but I don't want to do that.
Well then post a list of the example sites.
drudgereport.com is one that uses javascript, I think.
That site is extremely slow here and apparently doesn't autoreload. Any other examples?
Strange, it's very fast here and reloads frequently. I'll have to keep looking for another example. Thanks.
The site managed to reload itself after a while. Its script uses window.location.reload
and userscripts cannot overwrite/block it. The only solution is to write/use a browser extension that blocks http request to load the url. Try Requestly extension and make a rule to block http://drudgereport.com
when the "source" (request initiator) is http://drudgereport.com
or maybe some other condition, idk.
maybe try this :
http://userscripts-mirror.org/scripts/show/125995
this script kills all setInterval/setTimeout callbacks; sometimes it helps.
Thanks guys. No success so far with either of those two possibilities, but I asked over at the Requestly extension page, so we shall see.
I somehow misunderstood you. The 5th line of drudgereport.com script is:
var timer = setInterval("autoRefresh()", 1000 * 47 * 3);
Just kill this timer and all annoyances will be cured?
Hi. Sounds good to me, though I don't know how. I could kill script on the whole page, but that nukes other valuable things, so the idea is to focus on the autorefresh. I've seen many complaints about this behavior, but never an adequate solution.
// ==UserScript==
// @name Drudge Report - No Reload
// @namespace Drudge Report
// @description Disable automatic reloads on Drudge Report.
// @include http://drudgereport.com/*
// @version 1
// @grant none
// ==/UserScript==
var script = document.createElement("script");
script.innerHTML = '(function(){clearInterval(timer); autoRefresh = function(){};})();';
var body = document.getElementsByTagName("body")[0];
body.appendChild(script);
Thanks, but that doesn't work here.
Try updated script.
Still doesn't work.
add an * or www. after http://
// @include http://*drudgereport.com/*
TamperMonkey/Chrome was a little more picky.
Dude, you nailed it! Great script. This should get uploaded. I know there's demand for killing autorefresh. Thanks much!
Sad thing is it's only for that website as all sites will use their own method(s).
Well thanks anyway. Much appreciated.
[script request] Stop auto-reload of page
Is there a script available that will stop pages from reloading themselves? I view a lot of news sites and this is a common problem. You will be reading the page - or writing a comment! - and the page will refresh suddenly.
Thanks.