开发者

Is it possible to disable meta refresh in Google Chrome?

开发者 https://www.devze.com 2023-04-11 21:47 出处:网络
On pages with meta refresh, is there any way to开发者_Python百科 disable meta refresh, within a Google Chrome extension?I was looking for the same kind of extension (Spanish online newspapers abuse of

On pages with meta refresh, is there any way to开发者_Python百科 disable meta refresh, within a Google Chrome extension?


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.


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)


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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号