code: function getMetaRefresh(document) {
    const refresh = document.querySelector('meta[http-equiv="refresh"]');
    if (refresh) {
      const content = refresh.getAttribute('content');
      const match   = content.match(/^\s*(\d+)(?:\s*;\s*url\s*=\s*(.*?))?\s*(?:;|$)/i);
      if (match) {
        const refreshTimeout = parseInt(match[1], 10);
        const refreshURL     = match[2] || document.location.href;
        if (refreshTimeout >= 0)
          return { refreshTimeout, refreshURL };
      }
    }
    return null;
  }
docs: Get refresh URL and timeout from <meta> tag