23

On pages with meta refresh, is there any way to disable meta refresh, within a Google Chrome extension?

Brad
  • 159,648
  • 54
  • 349
  • 530
supercoolville
  • 8,636
  • 20
  • 52
  • 69
  • See this question: http://stackoverflow.com/questions/2568760/is-it-possible-to-use-javascript-to-change-the-meta-tags-of-the-page/2568801#2568801 – Brad Oct 11 '11 at 01:33
  • Can you try this workaround in Chrome? It works in Opera. Retrieve the original markup, find and replace the meta refresh element, and then write the new document with the replaced markup. See my answer: [http://stackoverflow.com/questions/3252743/using-javascript-to-override-or-disable-meta-refresh-tag/13656851#13656851](http://stackoverflow.com/questions/3252743/using-javascript-to-override-or-disable-meta-refresh-tag/13656851#13656851). – XP1 Dec 01 '12 at 06:16

4 Answers4

17

I was looking for the same kind of extension (Spanish online newspapers abuse of the meta/refresh tag), I found none, and, among other sites, I landed in this question.

So I started to analyze how this could be done. It was not simple, and needed some tricks, but I've done it.

The extension is already in Chrome Web Store, "Stop Autorefresh": https://chrome.google.com/webstore/detail/lcldcllmbokpbniijpnkpgoboadbfphb

More info, mostly in Spanish, in http://gallir.wordpress.com/2012/07/12/stop-autorefresh-evitar-la-recarga-automatica-tipica-de-los-periodicos-digitales-en-chromechromium/

From the extension description:

Implementation notes: Chrome and Chromium don't allow to disable the refresh meta tag, nor they provide an easy method for cancelling it. The extension uses a http trick. When the [unavoidable] refresh is fired, it intercepts it, checks if it's the refresh event, if so, it redirects the connection to a small script (currently en App Engine). This script just returns a 204 http status code, so the browser does not modify the content of the page, and doesn't try to refresh it again.

gallir
  • 242
  • 2
  • 5
  • 1
    @DaveBurton "Doesn't work" in the comments of the CWS entry, I presume? I confirm that redirecting to a page with status 204 works as intended: The previous page is not unloaded. – Rob W Aug 28 '13 at 08:29
  • it does not do anything currently on pages with `` refresh – törzsmókus Dec 21 '15 at 10:07
  • The Chrome webstore link is 404'ing. A cursory search for other extensions named "Stop Autorefresh" returned 3 results that all seemed focused on creating timed automatic refreshes. – Patrick M Dec 03 '21 at 08:41
12

Following on from Shluch's solution, you can create yourself a bookmark named "Stop Refresh" and set the URL to:

javascript:window.setInterval(function () {window.stop()},10)
Simon Dyson
  • 625
  • 5
  • 7
7

I made a solution. It is little buggy (if you loading ajax images, I think), but It's do the job:

window.setInterval(function () {window.stop()},10)
Shluch
  • 423
  • 4
  • 13
5

Chrome does not natively support any settings to block META refreshes nor are there any related Extensions currently.

Also, there was an issue with disabling meta refresh on Chrome in the past. I'm not sure it's fixed now.

I also found the topic was already discussed on webapps.

Community
  • 1
  • 1
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364