From 87c1fcc0fd6e118c2e33ad5c11729ec84d78f900 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 28 Jan 2012 19:47:58 +0100 Subject: [PATCH] Fix $.ready for Opera as it loads userscripts on window.onload and not document-start. --- 4chan_x.user.js | 2 +- changelog | 1 + script.coffee | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 18a06fa11..b458cf5a5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -312,7 +312,7 @@ $.extend($, { ready: function(fc) { var cb; - if (/interactive|complete/.test(d.readyState)) return fc(); + if (/interactive|complete/.test(d.readyState)) return setTimeout(fc); cb = function() { $.off(d, 'DOMContentLoaded', cb); return fc(); diff --git a/changelog b/changelog index e71d58f30..5f56e4552 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - Mayhem Index Navigation and the See next/previous thread keybinds will not cycle through board pages anymore. + Fix archive redirection in Opera. 2.24.4 - ahokadesuka diff --git a/script.coffee b/script.coffee index 5f8dd3ccd..3eb398ebe 100644 --- a/script.coffee +++ b/script.coffee @@ -223,7 +223,9 @@ $.extend = (object, properties) -> $.extend $, ready: (fc) -> if /interactive|complete/.test d.readyState - return fc() + # Execute the functions in parallel. + # If one fails, do not stop the others. + return setTimeout fc cb = -> $.off d, 'DOMContentLoaded', cb fc()