summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/bootstrap.js b/src/bootstrap.js
index 0fbc56e..c49e1ca 100644
--- a/src/bootstrap.js
+++ b/src/bootstrap.js
@@ -4,10 +4,8 @@ if (typeof EIB === "undefined")
pending: []
};
-const Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils, CC = Components.Constructor, Cr = Components.results;
+const Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils, CC = Components.Constructor;
const ScriptableInputStream = CC("@mozilla.org/scriptableinputstream;1", "nsIScriptableInputStream", "init");
-const FileInputStream = CC("@mozilla.org/network/file-input-stream;1", "nsIFileInputStream", "init");
-const LocalFileFromPath = CC("@mozilla.org/file/local;1", "nsILocalFile", "initWithPath");
Cu.import("resource://gre/modules/Services.jsm");
@@ -26,7 +24,7 @@ var ServerListener = {
buf += sis.read(2048);
if (buf.indexOf("\r\n\r\n") > -1) {
- is.close();
+ sis.close();
// parse out headers
var headers = {};
@@ -84,7 +82,7 @@ var ServerListener = {
EIB.listen = function () {
this.serverSocket = Cc["@mozilla.org/network/server-socket;1"]
- .createInstance(Ci.nsIServerSocket);
+ .createInstance(Ci.nsIServerSocket);
this.serverSocket.init(26001, true, -1);
this.serverSocket.asyncListen(ServerListener);
};
@@ -109,17 +107,14 @@ function forEachOpenWindow(todo) {
}
var WindowListener = {
- onOpenWindow: function(xulWindow)
- {
+ onOpenWindow: function(xulWindow) {
var window = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
- function onWindowLoad()
- {
+ window.addEventListener("load", function onWindowLoad() {
window.removeEventListener("load", onWindowLoad);
if (window.document.documentElement.getAttribute("windowtype") == "navigator:browser")
loadIntoWindow(window);
- }
- window.addEventListener("load", onWindowLoad);
+ });
},
};
@@ -197,9 +192,9 @@ function injectCCPEVE(e) {
}
function loadIntoWindow(window) {
- window.document.getElementById("appcontent").addEventListener("DOMContentLoaded", injectCCPEVE, false);
+ window.document.getElementById("appcontent").addEventListener("DOMContentLoaded", injectCCPEVE);
}
function unloadFromWindow(window) {
- window.document.getElementById("appcontent").removeEventListener("DOMContentLoaded", injectCCPEVE, false);
+ window.document.getElementById("appcontent").removeEventListener("DOMContentLoaded", injectCCPEVE);
}