-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathinit.js
More file actions
35 lines (33 loc) · 1.06 KB
/
Copy pathinit.js
File metadata and controls
35 lines (33 loc) · 1.06 KB
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
// Do the initialization
$(function() {
if (window.top === window) {
// The parent frame is the top-level frame, not an iframe.
console.log(["Initing DepthJS", DepthJS]);
DepthJS.selectorBox.init();
DepthJS.eventLink.initPort();
DepthJS.depthose.init();
// Let us know its running
console.log("Finished initing, sticking in logo");
$("<img/>").attr("src", chrome.extension.getURL("logo_128x128.png"))
.css({
position: "fixed",
width: "32px",
height: "32px",
bottom: "20px",
left: "20px"
})
.appendTo("body");
var lastTime = null;
function reloadChecker() {
setTimeout(reloadChecker, 1000);
if (lastTime == null) {
lastTime = new Date();
} else if ((new Date()) - lastTime > 1300) {
console.log("I think I reloaded, redoing init.");
DepthJS.browser.readdContentScriptListeners();
}
lastTime = new Date();
}
setTimeout(reloadChecker, 1000);
}
});