Prepend all links that are not intra-site with a string in JS... Can you just proofread this quick little script I hacked together?
<p>The idea is to route the outgoing links through DDG's redirect service, to conceal my site in referrers.  Is there anything wrong with the script as it is?</p>

<p>Also, see the comment in the code... Is the mentioned alternative superior? Inferior? Identical?</p>

<p>Thanks again!</p>

<pre><code>var baseUrl='https://duckduckgo.com/l/?u=';

var invisibleHost=window.location.hostname;

var pageLinks=document.getElementsByTagName('a');
var n_links=pageLinks.length;

var leaveAsIs=true;

for(var i=0;i&lt;n_links;i++){

    var presentLink=pageLinks[i].href;
    leaveAsIs=true;

    if(/^https?:\/\//i.test(presentLink) &amp;&amp; invisibleHost.test(presentLink))
        leaveAsIs=false;

    pageLinks[i].href=leaveAsIs?presentLink:baseUrl+presentLink;
}
</code></pre>
