noreferrer 0.8 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -2
- data/noreferrer.gemspec +1 -1
- data/vendor/assets/javascripts/jquery.noreferrer.js +2 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -7,8 +7,6 @@ Gem for a Rails project that removes referrer information on an html link
|
|
7
7
|
Include this in your application.js file:
|
8
8
|
//= require jquery.noreferrer.js
|
9
9
|
|
10
|
-
$('a').noreferrer([css selector],[array of strings to be regex matched with link hrefs])
|
11
|
-
|
12
10
|
Example:
|
13
11
|
The following exmaple will intercept and remove the referrer information to any links that link to google.
|
14
12
|
|
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.9
|
8
8
|
gem.authors = ["Rodney Carvalho"]
|
9
9
|
gem.email = ["rcarvalho@atlantistech.com"]
|
10
10
|
gem.description = "Removes referrer information on an html link."
|
@@ -21,12 +21,14 @@
|
|
21
21
|
$(document.body).on('click', selector, function(e){
|
22
22
|
if(matches == undefined){
|
23
23
|
NoReferrer.Link.go($(this).attr('href'), $(this).attr('target'));
|
24
|
+
e.preventDefault();
|
24
25
|
return false;
|
25
26
|
}
|
26
27
|
else{
|
27
28
|
for(i=0;i<matches.length;i++){
|
28
29
|
if(new RegExp(matches[i]).test($(this).attr('href'))){
|
29
30
|
NoReferrer.Link.go($(this).attr('href'), $(this).attr('target'));
|
31
|
+
e.preventDefault();
|
30
32
|
return false;
|
31
33
|
}
|
32
34
|
}
|
@@ -81,7 +83,6 @@
|
|
81
83
|
}
|
82
84
|
else if(NoReferrer.Browser.browser['webkit']){
|
83
85
|
wnd.location = "data:text/html,<script>location='" + url + ((new RegExp(/\?/).test(url)) ? '&_=' : '?_=') + Math.random() + "'</scr"+"ipt>";
|
84
|
-
return false;
|
85
86
|
}
|
86
87
|
else if(NoReferrer.Browser.browser['mozilla']){
|
87
88
|
wnd.location = 'data:text/html,<html><meta http-equiv="refresh" content="0; url='+ url + '"></html>';
|