Work around strange order of execution bug in Firefox. Fixes #620

This commit is contained in:
Chad Weider 2012-04-11 02:01:53 -07:00
parent b767192c58
commit e695c716e5
1 changed files with 7 additions and 2 deletions

View File

@ -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 {