-
Notifications
You must be signed in to change notification settings - Fork 1
/
Google_Search_Anti-SEO.user.js
191 lines (165 loc) · 8.13 KB
/
Google_Search_Anti-SEO.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// ==UserScript==
// @name Google_Search_Anti-SEO
// @namespace http://sandroalvares.com.br
// @version 5.30
// @description Google Anti-SEO Links without Adblock - Menos Anuncio
// @author KingRider 2010 a atual
// @match http*://*.google.com/search?*
// @match http*://*.google.com.br/search?*
// @require http://code.jquery.com/jquery-1.9.1.min.js
// @xxrequire http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @updateURL https://github.com/KingRider/userscripts/raw/master/Google_Search_Anti-SEO.user.js
// @downloadURL https://github.com/KingRider/userscripts/raw/master/Google_Search_Anti-SEO.user.js
// @grant none
// ==/UserScript==
if (jQuery) {
$(document).ready(function() {
//$(document).bind('keyup.f4', function() {
setInterval(function() {
var x = 0, y = 0, z = 0, xx = 0, xy = 0, temp = '';
/*
for (antiseo=0; antiseo < document.querySelectorAll('div.g h3 a').length; antiseo++) {
document.querySelectorAll('div.g h3 a')[antiseo].removeAttribute('onmousedown');
}
*/
/*
for (x=0; x < $('a').length; x++) {
if($($('a')[x]).attr('href')) {
if ($($('a')[x]).attr('href').indexOf('googleadservices.com/pagead/aclk') > 0) {
valor1 = $($('a')[x]).next().attr('href');
$($('a')[x]).attr('href',valor1.replace(/[_\W]+/g, "."));
};
};
};
*/
// -- Pesquisa do texto
for (y=0; y < $("span:contains('Anúncio')").length; y++) {
$('[onmousedown]').removeAttr('onmousedown');
//temp = $($("span:contains('Anúncio')").parent()[y]).text().substr(+);
if ($("a span:contains('Anúncio')").parent().parent()[y]) {
temp = $("a span:contains('Anúncio')").parent().parent()[0].dataset.pcu.split(',')[0]; //$("a span:contains('Anúncio')").parent().parent()[y].href;
if (temp) {
if ($($("span:contains('Anúncio')").parent().parent()[y]).length) {
$($("span:contains('Anúncio')").parent().parent()[y])[0].href = temp;
$($("span:contains('Anúncio')").parent().parent()[y])[0].href = $($("span:contains('Anúncio')").parent().parent()[y])[0].href.replace(/%E2%80%8E/g, "");
}
if ($($("span:contains('Anúncio')").parent().parent()[y]).prev().length) {
$($("span:contains('Anúncio')").parent().parent()[y]).prev()[0].href = temp;
$($("span:contains('Anúncio')").parent().parent()[y]).prev()[0].href = $($("span:contains('Anúncio')").parent().parent()[y]).prev()[0].href.replace(/%E2%80%8E/g, "");
}
if ($('a[data-pcu]').length) {
$('a[data-pcu]')[y].href = temp;
$('a[data-pcu]')[0].dataset.rw = temp;
$('a[data-pcu]')[0].dataset.pfu = temp;
console.log('['+y+'] '+temp);
}
}
}
temp = "";
}
// -- Pesquisa do produto
setInterval(function(){
if (document.querySelectorAll('div[class*=group]').length > 0) {
for (z=0; z < document.querySelectorAll('div[class*=group]')[0].childNodes.length; z++) {
if ($(document.querySelectorAll('div[class*=group]')[0].childNodes[z]).find('a[href*="/aclk"][style="display:none"]')) {
$(document.querySelectorAll('div[class*=group]')[0].childNodes[z]).find('a[href*="/aclk"][style="display:none"]').remove();
}
document.querySelectorAll('a')[z].removeAttribute("ontouchstart");
document.querySelectorAll('a')[z].removeAttribute("ontouchstart");
document.querySelectorAll('a')[z].removeAttribute("arwt");
}
} else if (document.querySelectorAll('div[class*=container]').length > 0) {
for (xx=0; xx < document.querySelectorAll('div[class*=container]')[0].childNodes.length; xx++) {
if ($(document.querySelectorAll('div[class*=container]')[0].childNodes[z]).find('a[href*="/aclk"][style="display:none"]')) {
$(document.querySelectorAll('div[class*=container]')[0].childNodes[z]).find('a[href*="/aclk"][style="display:none"]').remove();
}
}
for (xy=0; xy < document.querySelectorAll('div[class*=container]').length; xy++) {
if (document.querySelectorAll('div[class*=container]')[xy].innerText.includes("Patrocinados")) {
document.querySelectorAll('div[class*=container]')[xy].remove();
}
}
}
if ($('li.ads\-ad').length) {
$('li.ads\-ad').remove();
}
}, 1200);
//console.log($.now());
}, 2000);
if (window.location.pathname == "/url" && document.body.innerText.search('Aviso de redirecionamento') === 0) {
window.location.href = unescape(window.location.search.replace("?hl=pt-BR&q=", ""));
};
});
}
/*
if ($('div.rc h3.r a').length) {
var healerReplaced = $('body').html().replace(/data-href="([^\'\"]+)/gi, '');
$('body').html(healerReplaced);
}
*/
/*
$(document).ready(function() {
setInterval(function() {
console.log(document.querySelectorAll('a[data-href]').length);
for (x=0; x < document.querySelectorAll('a[data-href]').length; x++) {
console.log(x);
if (typeof(document.querySelectorAll('a[data-href]')[x]) != "undefined") {
try {
//document.querySelectorAll('div#search a')[x].setAttribute('href', document.querySelectorAll('div#search a')[x].getAttribute('data-href'));
sa_link = decodeURIComponent(document.querySelectorAll('a[data-href]')[x].href.substring((document.querySelectorAll('a[data-href]')[x].href.indexOf('url=')+4), document.querySelectorAll('a[data-href]')[x].href.indexOf('&usg')));
document.querySelectorAll('a[data-href]')[x].href = sa_link;
console.log(sa_link);
sa_link = "";
} catch(e) { console.log(x); }
}
}
}, 1500);
});
*/
/*
$('div.rc h3.r a[data-href]').each(function() {
$(this).attr('href', $(this).attr('data-href'));
});
*/
/*
$.each( $('div.rc h3.r a[data-href]'), function() {
$(this).attr('href', $(this).attr('data-href'));
});
*/
/*
$.each(function() {
$(('div.rc h3.r a[data-href]')).attr('href', ('div.rc h3.r a[data-href]').attr('data-href'));
});
*/
/*
if ($('body:contains("http://www.wikihow.com/Disable-Adblock")').length) {
var healerReplaced = $('body').html().replace(/\<style\>#(.*?)\{/gi, '#stopHacker{');
$('body').html(healerReplaced);
}
------------------------------------------------------------------------------------------------
$("div.rc h3.r a").each(function() {
var text = $(this).text();
text = text.replace("data-href", "href");
$(this).text(text);
});
------------------------------------------------------------------------------------------------
$('a').each(function(e){
var queryString = this.href;
queryString = queryString.substring(queryString.indexOf('?'), queryString.length);
var params = new Array();
while (queryString)
{
var front = queryString.indexOf('&d-')+1;
var back = queryString.indexOf('&d-')+10;
if (front) {
params.push(queryString.substring(front, back));
queryString = queryString.substring(back, queryString.length);
}
else
queryString = '';
}
var functionCall = 'callMethod('+params[0]+', '+params[1]+', '+params[2]+');';
$(this).attr('onclick', functionCall);
this.innerHTML = functionCall;
});
*/