noreferrer 0.7 → 0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/noreferrer.gemspec +1 -1
- data/vendor/assets/javascripts/jquery.noreferrer.js +11 -38
- metadata +1 -1
data/noreferrer.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |gem|
|
|
6
6
|
gem.name = "noreferrer"
|
|
7
|
-
gem.version = 0.
|
|
7
|
+
gem.version = 0.8
|
|
8
8
|
gem.authors = ["Rodney Carvalho"]
|
|
9
9
|
gem.email = ["rcarvalho@atlantistech.com"]
|
|
10
10
|
gem.description = "Removes referrer information on an html link."
|
|
@@ -68,50 +68,23 @@
|
|
|
68
68
|
},
|
|
69
69
|
Link: {
|
|
70
70
|
go: function(url, target){
|
|
71
|
+
var wnd = null;
|
|
72
|
+
if(target == '_blank'){
|
|
73
|
+
wnd = window.open();
|
|
74
|
+
}
|
|
75
|
+
else{
|
|
76
|
+
wnd = window;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
if(NoReferrer.Browser.browser['msie']){
|
|
72
|
-
|
|
73
|
-
if(target == '_blank'){
|
|
74
|
-
window.open(url + '&_='+Math.random());
|
|
75
|
-
}
|
|
76
|
-
else{
|
|
77
|
-
location = url + '&_='+Math.random();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else{
|
|
81
|
-
if(target == '_blank'){
|
|
82
|
-
window.open(url + '?_='+Math.random());
|
|
83
|
-
}
|
|
84
|
-
else{
|
|
85
|
-
location = url + '?_='+Math.random();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
80
|
+
wnd.location = url + ((new RegExp(/\?/).test(url)) ? '&_=' : '?_=') + Math.random();
|
|
88
81
|
}
|
|
89
82
|
else if(NoReferrer.Browser.browser['webkit']){
|
|
90
|
-
|
|
91
|
-
if(target == '_blank'){
|
|
92
|
-
window.open("data:text/html,<script>location='" + url + '&_=' + Math.random() + "'</scr"+"ipt>");
|
|
93
|
-
}
|
|
94
|
-
else{
|
|
95
|
-
location = "data:text/html,<script>location='" + url + '&_=' + Math.random() + "'</scr"+"ipt>";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else{
|
|
99
|
-
if(target == '_blank'){
|
|
100
|
-
window.open("data:text/html,<script>location='" + url + '?_=' + Math.random() + "'</scr"+"ipt>");
|
|
101
|
-
}
|
|
102
|
-
else{
|
|
103
|
-
location = "data:text/html,<script>location='" + url + '?_=' + Math.random() + "'</scr"+"ipt>";
|
|
104
|
-
}
|
|
105
|
-
}
|
|
83
|
+
wnd.location = "data:text/html,<script>location='" + url + ((new RegExp(/\?/).test(url)) ? '&_=' : '?_=') + Math.random() + "'</scr"+"ipt>";
|
|
106
84
|
return false;
|
|
107
85
|
}
|
|
108
86
|
else if(NoReferrer.Browser.browser['mozilla']){
|
|
109
|
-
|
|
110
|
-
window.open('data:text/html,<html><meta http-equiv="refresh" content="0; url='+ url + '"></html>');
|
|
111
|
-
}
|
|
112
|
-
else{
|
|
113
|
-
location = 'data:text/html,<html><meta http-equiv="refresh" content="0; url='+ url + '"></html>';
|
|
114
|
-
}
|
|
87
|
+
wnd.location = 'data:text/html,<html><meta http-equiv="refresh" content="0; url='+ url + '"></html>';
|
|
115
88
|
}
|
|
116
89
|
}
|
|
117
90
|
}
|