Discussions » Creation Requests

[script request] Stop auto-reload of page

§
Posted: 2015-09-07

[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.

wOxxOmMod
§
Posted: 2015-09-07

Googling it shows me there are addons and config tweaks for FF and extensions for Chrome.

§
Posted: 2015-09-07

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.

wOxxOmMod
§
Posted: 2015-09-07

Well then post a list of the example sites.

§
Posted: 2015-09-07

drudgereport.com is one that uses javascript, I think.

wOxxOmMod
§
Posted: 2015-09-07

That site is extremely slow here and apparently doesn't autoreload. Any other examples?

§
Posted: 2015-09-07

Strange, it's very fast here and reloads frequently. I'll have to keep looking for another example. Thanks.

wOxxOmMod
§
Posted: 2015-09-07
Edited: 2015-09-07

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.

§
Posted: 2015-09-07
Edited: 2015-09-07

maybe try this :
http://userscripts-mirror.org/scripts/show/125995
this script kills all setInterval/setTimeout callbacks; sometimes it helps.

§
Posted: 2015-09-07

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.

§
Posted: 2015-09-07

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?

§
Posted: 2015-09-07

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.

Deleted user 15079
§
Posted: 2015-09-08
Edited: 2015-09-08

// ==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);
§
Posted: 2015-09-08

Thanks, but that doesn't work here.

Deleted user 15079
§
Posted: 2015-09-08

Try updated script.

§
Posted: 2015-09-08

Still doesn't work.

Deleted user 15079
§
Posted: 2015-09-08
Edited: 2015-09-08

add an * or www. after http://

// @include http://*drudgereport.com/*

TamperMonkey/Chrome was a little more picky.

§
Posted: 2015-09-08

Dude, you nailed it! Great script. This should get uploaded. I know there's demand for killing autorefresh. Thanks much!

Deleted user 15079
§
Posted: 2015-09-08
Edited: 2015-09-08

Sad thing is it's only for that website as all sites will use their own method(s).

§
Posted: 2015-09-08

Well thanks anyway. Much appreciated.

Post reply

Sign in to post a reply.