diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index d354f9c5d..9aa9aa4c3 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9451,11 +9451,9 @@ posts = Object.keys(Unread.thread.posts); root = Unread.thread.posts[posts[posts.length - 1]].nodes.root; } - return $.on(window, 'load', function() { - if (Header.getBottomOf(root) < 0) { - return Header.scrollTo(root, down); - } - }); + if (Header.getBottomOf(root) < 0) { + return Header.scrollTo(root, down); + } }, sync: function() { var lastReadPost; diff --git a/builds/crx/script.js b/builds/crx/script.js index 50149405a..5066a03c1 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9434,11 +9434,9 @@ posts = Object.keys(Unread.thread.posts); root = Unread.thread.posts[posts[posts.length - 1]].nodes.root; } - return $.on(window, 'load', function() { - if (Header.getBottomOf(root) < 0) { - return Header.scrollTo(root, down); - } - }); + if (Header.getBottomOf(root) < 0) { + return Header.scrollTo(root, down); + } }, sync: function() { var lastReadPost; diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 36d5f5213..385383639 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -46,11 +46,9 @@ Unread = # Scroll to the last read post. posts = Object.keys Unread.thread.posts {root} = Unread.thread.posts[posts[posts.length - 1]].nodes - # Prevent the browser to scroll back to - # the previous scroll location on page load. - $.on window, 'load', -> - # Scroll to the target unless we scrolled past it. - Header.scrollTo root, down if Header.getBottomOf(root) < 0 + + # Scroll to the target unless we scrolled past it. + Header.scrollTo root, down if Header.getBottomOf(root) < 0 sync: -> lastReadPost = Unread.db.get