diff --git a/jquery.noreferrer.js b/jquery.noreferrer.js index f833012..580615f 100644 --- a/jquery.noreferrer.js +++ b/jquery.noreferrer.js @@ -1,10 +1,10 @@ /* jquery.noreferrer.js, version 0.1.3 - https://github.com/knu/noreferrer + https://github.com/knu/noreferrer - Copyright (c) 2011 Akinori MUSHA - Licensed under the 2-clause BSD license. + 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="",$.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); +(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(a){b.href="javascript:void(0)"},f=function(a){b.href=c},$(b).bind("mouseout mouseover focus blur",f).mousedown(function(a){2===a.which&&(d=!0)}).blur(function(a){d=!1}).mouseup(function(a){if(2!== +a.which||!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="",$.browser.msie||navigator.userAgent.match(/Trident.*rv\:11\./)?$(b).click(function(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(a){this.href=h;return!0})))})})})()}).call(this); diff --git a/src/jquery.noreferrer.coffee b/src/jquery.noreferrer.coffee index 83f49de..d647205 100644 --- a/src/jquery.noreferrer.coffee +++ b/src/jquery.noreferrer.coffee @@ -63,7 +63,8 @@ do -> body = "').text(href).html()}' />" - if $.browser.msie + # IE <= 11, the current jquery mainline version will not support IE11 with $.browser + if $.browser.msie || !!navigator.userAgent.match(/Trident.*rv\:11\./) $(a).click (ev) -> switch target = @target || '_self' when '_self', window.name