Skip to content

Instantly share code, notes, and snippets.

@Zegnat
Created November 15, 2014 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zegnat/d46e845831f8789e18bd to your computer and use it in GitHub Desktop.
Save Zegnat/d46e845831f8789e18bd to your computer and use it in GitHub Desktop.
(function(links){
for (
var linkCount = links.length, i = 0;
i < linkCount;
i++
) if ((' ' + (links[i].getAttribute('rel') || '').replace(/[\s]/g, ' ') + ' ').indexOf(' noreferrer ') >= 0)
links[i].href = 'data:text/html;base64,' + btoa('<!doctype html><meta http-equiv="refresh" content="0;URL=\'' + encodeURI(links[i].href) + '\'">');
})(document.links);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment