diff --git a/4chan_x.user.js b/4chan_x.user.js index 7dbe40bdf..bd11fdfa1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2823,6 +2823,7 @@ main = { init: function() { var callback, canPost, cutoff, form, hiddenThreads, id, lastChecked, now, op, pathname, table, temp, timestamp, tzOffset, _i, _j, _k, _l, _len, _len2, _len3, _len4, _ref2, _ref3, _ref4, _ref5, _ref6; + $.unbind(window, 'load', main.init); pathname = location.pathname.substring(1).split('/'); g.BOARD = pathname[0], temp = pathname[1]; if (temp === 'res') { @@ -3213,5 +3214,9 @@ }\ ' }; - main.init(); + if (d.body) { + main.init(); + } else { + $.bind(window, 'load', main.init); + } }).call(this); diff --git a/script.coffee b/script.coffee index ab4ac8cff..31f88edbd 100644 --- a/script.coffee +++ b/script.coffee @@ -2176,6 +2176,7 @@ firstRun = main = init: -> + $.unbind window, 'load', main.init pathname = location.pathname.substring(1).split('/') [g.BOARD, temp] = pathname if temp is 'res' @@ -2548,4 +2549,8 @@ main = } ' -main.init() +#XXX Opera will load early if script is saved w/o .user +if d.body + main.init() +else + $.bind window, 'load', main.init