diff --git a/4chan_x.user.js b/4chan_x.user.js
index 399ef7904..1f6cd3e7d 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -1555,6 +1555,14 @@
updater = {
init: function() {
var checkbox, checked, dialog, html, input, name, title, _i, _len, _ref;
+ if (conf['Scrolling']) {
+ $.bind(window, 'focus', (function() {
+ return updater.focus = true;
+ }));
+ $.bind(window, 'blur', (function() {
+ return updater.focus = false;
+ }));
+ }
html = "
-" + conf['Interval'] + "
";
checkbox = config.updater.checkbox;
for (name in checkbox) {
@@ -1644,7 +1652,7 @@
while ((reply = replies.pop()) && (reply.id > id)) {
arr.push(reply.parentNode.parentNode.parentNode);
}
- scroll = conf['Scrolling'] && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20);
+ scroll = updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20);
updater.timer.textContent = '-' + conf['Interval'];
if (conf['Verbose']) {
updater.count.textContent = '+' + arr.length;
diff --git a/script.coffee b/script.coffee
index 90d29f708..af298c196 100644
--- a/script.coffee
+++ b/script.coffee
@@ -1255,6 +1255,9 @@ threadHiding =
updater =
init: ->
+ if conf['Scrolling']
+ $.bind window, 'focus', (-> updater.focus = true)
+ $.bind window, 'blur', (-> updater.focus = false)
html = " -#{conf['Interval']}
"
{checkbox} = config.updater
for name of checkbox
@@ -1330,7 +1333,7 @@ updater =
while (reply = replies.pop()) and (reply.id > id)
arr.push reply.parentNode.parentNode.parentNode #table
- scroll = conf['Scrolling'] && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20)
+ scroll = updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20)
updater.timer.textContent = '-' + conf['Interval']
if conf['Verbose']