diff --git a/4chan_x.user.js b/4chan_x.user.js index 7315ecd99..e255076c3 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -313,11 +313,7 @@ ready: function(fc) { var cb; if (/interactive|complete/.test(d.readyState)) { - try { - fc(); - } finally { - return; - } + $.queueTask(fc); } cb = function() { $.off(d, 'DOMContentLoaded', cb); diff --git a/script.coffee b/script.coffee index 17d47a35c..ba6e87caf 100644 --- a/script.coffee +++ b/script.coffee @@ -263,10 +263,7 @@ $.extend $, d.getElementById id ready: (fc) -> if /interactive|complete/.test d.readyState - try - fc() - finally - return + $.queueTask fc cb = -> $.off d, 'DOMContentLoaded', cb fc()