From 4c11297e497a31a2be907d0778221700e51bb64a Mon Sep 17 00:00:00 2001 From: Jeremy Maitin-Shepard Date: Sat, 9 Feb 2013 17:13:18 -0800 Subject: [PATCH] window.js: Ensure that window_initialize_late_hook is run before other "late" hooks By itself, this doesn't fix anything, but it makes more sense and may allow for a more robust scrollbar fix. --- modules/window.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/window.js b/modules/window.js index 1837e61..77fcbcb 100644 --- a/modules/window.js +++ b/modules/window.js @@ -203,18 +203,24 @@ function window_initialize (window) { return this.buffers.current.browser.contentWindow; }); - window_initialize_early_hook.run(window); - delete window.window_initialize_early_hook; // used only once - - window_initialize_hook.run(window); - delete window.window_initialize_hook; // used only once + // Tell Mozilla the window_initialize_late_hook to run after a timeout + // Do this here, before doing the rest of the window + // initialization, so that window_initialize_late_hook will be run + // prior to any other "late" hooks set up by other modules in a + // function registered in window_initialize{_early,}_hook. window.setTimeout(function () { window_initialize_late_hook.run(window); delete window.window_initialize_late_hook; // used only once delete window.args; // get rid of args }, 0); + window_initialize_early_hook.run(window); + delete window.window_initialize_early_hook; // used only once + + window_initialize_hook.run(window); + delete window.window_initialize_hook; // used only once + window.addEventListener("close", function (event) { event.preventDefault(); -- 2.11.4.GIT