Greasy Fork is available in English.

Disable AutoRefresh

Disable AutoRefresh is a user script to override and disable meta refresh html tag on all websites to prevent the automatic refresh or redirection.

Ekde 2016/01/11. Vidu La ĝisdata versio.

// ==UserScript==
// @name Disable AutoRefresh
// @name:fr Disable AutoRefresh
// @namespace Disable AutoRefresh
// @description Disable AutoRefresh is a user script to override and disable meta refresh html tag on all websites to prevent the automatic refresh or redirection.
// @description:fr Disable AutoRefresh est un user script pour annuler et désactiver le tag html Meta refresh sur tous les sites web et empêcher le rafraîchissement automatique ou la redirection vers une autre page / site web.
// @author SMed79
// @version 1.2
// @encoding utf-8
// @license https://creativecommons.org/licenses/by-nc-sa/4.0/
// @icon http://i.imgur.com/ZJ9mHLO.png
// @twitterURL https://twitter.com/SMed79
// @contactURL http://tinyurl.com/contact-smed79
// @supportURL https://greasyfork.org/fr/scripts/16079-disable-autorefresh/feedback
// @include http://*
// @include https://*
// @run-at document-start
// @grant none
// ==/UserScript==

/*
immediate redirection. 
<meta http-equiv="refresh" content="0; url=http://www.exemple.com/">

5 second redirection.
<meta http-equiv="refresh" content="5; url=http://www.exemple.com/">
*/

(function () {
	
  window.addEventListener("DOMContentLoaded", function (event) {
  
    var allMetas,
    thisMeta,
    content,
    timeout,
    timeout_ms;

    allMetas = document.getElementsByTagName('meta');
    console.log(allMetas)
    for (var i = 0; i < allMetas.length; i++) {
      thisMeta = allMetas[i];

      if (thisMeta.httpEquiv.match(/refresh/i)) {
        if (thisMeta.content.match(/[\D]/)) {
          content = thisMeta.content.split(';');
          timeout = content[0];
          console.log(content);
          timeout_ms = (timeout > 1) ? (timeout - 1) * 1000 : 500;
          setTimeout("window.stop();", timeout_ms);
        }
      }
    }

  });

})();