Commit f66c6fd8 authored by Olivier's avatar Olivier

Create jquery.noreferrer.js

parent fa5bca3f
/*
jquery.noreferrer.js, version 0.1.3
https://github.com/knu/noreferrer
Copyright (c) 2011 Akinori MUSHA
Licensed under the 2-clause BSD license.
*/
(function(){(function(){$.browser.webkit||$.event.add(window,"load",function(){$("a[href][rel~=noreferrer], area[href][rel~=noreferrer]").each(function(){var b,e,c,g,d,f,h;b=this;c=b.href;$.browser.opera?(b.href="http://www.google.com/url?q="+encodeURIComponent(c),b.title||(b.title="Go to "+c)):(d=!1,g=function(){b.href="javascript:void(0)"},f=function(){b.href=c},$(b).bind("mouseout mouseover focus blur",f).mousedown(function(a){a.which===2&&(d=!0)}).blur(function(){d=!1}).mouseup(function(a){if(!(a.which===
2&&d))return!0;g();d=!1;setTimeout(function(){alert("Middle clicking on this link is disabled to keep the browser from sending a referrer.");f()},500);return!1}),e="<html><head><meta http-equiv='Refresh' content='0; URL="+$("<p/>").text(c).html()+"' /></head><body></body></html>",$.browser.msie?$(b).click(function(){var a;switch(a=this.target||"_self"){case "_self":case window.name:a=window;break;default:a=window.open(null,a)}a=a.document;a.clear();a.write(e);a.close();return!1}):(h="data:text/html;charset=utf-8,"+
encodeURIComponent(e),$(b).click(function(){this.href=h;return!0})))})})})()}).call(this);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment