-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtabjack.js
63 lines (51 loc) · 1.91 KB
/
tabjack.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
(function(){
var timer = null;
var isSwitched = false;
window.onblur = function(){ timer = setTimeout(doChange, 5000); }
window.onfocus = function(){ if (timer) clearTimeout(timer); }
favicon = {
docHead: document.getElementsByTagName("head")[0],
set: function(url){ this.addLink(url); },
addLink: function(iconURL) {
var link = document.createElement("link");
link.type = "image/x-icon";
link.rel = "shortcut icon";
link.href = iconURL;
this.removeLinkIfExists();
this.docHead.appendChild(link);
},
removeLinkIfExists: function() {
var links = this.docHead.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
var link = links[i];
if (link.type == "image/x-icon" && link.rel == "shortcut icon") {
this.docHead.removeChild(link);
return;
}
}
}
};
favicon.set("https://nulldev.org/img/logo.png");
function switchCont(){
$(".content").css("display", "none");
$(".content-x").css("display", "block");
}
function doChange(){
if (isSwitched == false){
document.title = "Gmail: Email from Google";
favicon.set("https://mail.google.com/favicon.ico");
switchCont();
isSwitched = true;
}
}
})();
$(document).ready(function() {
$("#g-send").click(function() {
/////////////////////////////////////////////////////
alert( //
"I hope you clicked that button ironically..." //
); //
/////////////////////////////////////////////////////
window.location = "https://www.google.com/gmail/";
});
});