← Back to context

Comment by nicoburns

4 days ago

I believe they're doing a meta-tag redirect (possibly inside a noscript tag?) in at least some cases. Source: I'm developing a web engine that doesn't have JS support.

That's exactly what they are doing:

    <!DOCTYPE html>
    <html>
      <head><title>Google Search</title>...</head>
      <body>
        <noscript>
          <meta content="0;url=/httpservice/retry/enablejs?sei=..." http-equiv="refresh">
          <div style="display:block">Please click <a href="/httpservice/retry/enablejs?sei=...">here</a> if you are not redirected within a few seconds.</div>
        </noscript>...

You're correct.

    <noscript><meta content="0;url=/httpservice/retry/enablejs?sei=a3qIZ42cGcvcp84P5p_mwQI" http-equiv="refresh"><style>table,div,span,p{display:none}</style><div style="display:block">Please click <a href="/httpservice/retry/enablejs?sei=a3qIZ42cGcvcp84P5p_mwQI">here</a> if you are not redirected within a few seconds.</div></noscript></header>

  • Here's a skeleton overlay.js for an old style firefox extension to mitigate the meta-redirect part of the blocking.

        var remover = {
            init: function() {
                var appcontent = document.getElementById("appcontent");
                if(appcontent) {
                    appcontent.addEventListener("DOMContentLoaded", 
                        function(e) {
                            var doc = e.originalTarget;
                            if(doc instanceof HTMLDocument) {
                                var noscripts = doc.getElementsByTagName('noscript');
                                for(var i = 0; i < noscripts.length; i++) {
                                    //if(noscripts[i].innerHTML.indexOf('meta content="0;url=/httpservice/retry/enablejs?sei=') != -1) {
                                        noscripts[i].parentNode.removeChild(noscripts[i]);
                                    //}
                                }
                            }
                        }, true);
                }
            }

    };

    window.addEventListener("load", function() { remover.init(); }, false);