From e695c716e55258b562de7e652078730f1df489a2 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Wed, 11 Apr 2012 02:01:53 -0700 Subject: [PATCH] Work around strange order of execution bug in Firefox. Fixes #620 --- src/static/js/pluginfw/plugins.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index 5f44bb6f2..e6cb51905 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -85,15 +85,20 @@ exports.extractHooks = function (parts, hook_set_name) { if (exports.isClient) { exports.update = function (cb) { + // It appears that this response (see #620) may interrupt the current thread + // of execution on Firefox. This schedules the response in the run-loop, + // which appears to fix the issue. + var callback = function () {setTimeout(cb, 0);}; + jQuery.getJSON('/pluginfw/plugin-definitions.json', function(data) { exports.plugins = data.plugins; exports.parts = data.parts; exports.hooks = exports.extractHooks(exports.parts, "client_hooks"); exports.loaded = true; - cb(); + callback(); }).error(function(xhr, s, err){ console.error("Failed to load plugin-definitions: " + err); - cb(); + callback(); }); }; } else {