-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.js
32 lines (28 loc) · 1022 Bytes
/
content.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
function run(hide) {
if (hide != "") {
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
var jqHide = '\'' + hide + '\'' ;
console.log("hiding: " + jqHide);
$("a.result-title:contains("+jqHide+")").next("span").children("span.banish").click();
}
}
$(document).ready(function() {
$("span#titletextonly").map(function(i, e) {
$(e).replaceWith($(e).text().toLowerCase());
console.log();
});
});
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(sender.tab ?
"from a content script:" + sender.tab.url :
"from the extension:");
$.each(request, function() { run(this); });
/*var otherArray = ["joe", "bob", "mike"];
$.each(otherArray, function(){console.log(this);});
sendResponse({test: "turtle",bob:"the builder"});*/
});