From c36c9d618573695adfce3e87ce17a021ccfd8bb1 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 4 Oct 2011 06:44:34 -0400 Subject: [PATCH] Remove beforeunload handler. --- common/content/commandline.js | 1 - common/modules/util.jsm | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index 82469616..130fbe24 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -290,7 +290,6 @@ var CommandWidgets = Class("CommandWidgets", { }), multilineOutput: Class.Memoize(function () this._whenReady("dactyl-multiline-output", function (elem) { - elem.contentWindow.addEventListener("beforeunload", function (event) { event.preventDefault(); }, true); highlight.highlightNode(elem.contentDocument.body, "MOW"); }), true), diff --git a/common/modules/util.jsm b/common/modules/util.jsm index f9db472b..af2d0897 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -381,13 +381,23 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), if (idx) { idx = Number(idx) - 1; stack.top.elements.push(update( - function (obj) obj[name] != null && idx in obj[name] ? quote(obj[name][idx]) : Set.has(obj, name) ? "" : unknown(full), - { test: function (obj) obj[name] != null && idx in obj[name] && obj[name][idx] !== false && (!flags.e || obj[name][idx] != "") })); + function (obj) obj[name] != null && idx in obj[name] ? quote(obj[name][idx]) + : Set.has(obj, name) ? "" : unknown(full), + { + test: function (obj) obj[name] != null && idx in obj[name] + && obj[name][idx] !== false + && (!flags.e || obj[name][idx] != "") + })); } else { stack.top.elements.push(update( - function (obj) obj[name] != null ? quote(obj[name]) : Set.has(obj, name) ? "" : unknown(full), - { test: function (obj) obj[name] != null && obj[name] !== false && (!flags.e || obj[name] != "") })); + function (obj) obj[name] != null ? quote(obj[name]) + : Set.has(obj, name) ? "" : unknown(full), + { + test: function (obj) obj[name] != null + && obj[name] !== false + && (!flags.e || obj[name] != "") + })); } for (let elem in array.iterValues(stack))