diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py
index a5a15e0db..1e625d93c 100644
--- a/qutebrowser/browser/webengine/webenginetab.py
+++ b/qutebrowser/browser/webengine/webenginetab.py
@@ -293,6 +293,7 @@ class WebEngineScroller(browsertab.AbstractScroller):
def __init__(self, tab, parent=None):
super().__init__(tab, parent)
+ self._args = objreg.get('args')
self._pos_perc = (0, 0)
self._pos_px = QPoint()
self._at_bottom = False
@@ -333,9 +334,11 @@ class WebEngineScroller(browsertab.AbstractScroller):
perc_y = min(100, round(100 / dy * jsret['px']['y']))
self._at_bottom = math.ceil(jsret['px']['y']) >= dy
- self._pos_perc = perc_x, perc_y
- self.perc_changed.emit(*self._pos_perc)
+ if (self._pos_perc != (perc_x, perc_y) or
+ 'no-scroll-filtering' in self._args.debug_flags):
+ self._pos_perc = perc_x, perc_y
+ self.perc_changed.emit(*self._pos_perc)
js_code = javascript.assemble('scroll', 'pos')
self._tab.run_js_async(js_code, update_pos_cb)
diff --git a/qutebrowser/qutebrowser.py b/qutebrowser/qutebrowser.py
index 1b1cfb013..ad53f45ca 100644
--- a/qutebrowser/qutebrowser.py
+++ b/qutebrowser/qutebrowser.py
@@ -159,7 +159,8 @@ def debug_flag_error(flag):
debug-exit: Turn on debugging of late exit.
pdb-postmortem: Drop into pdb on exceptions.
"""
- valid_flags = ['debug-exit', 'pdb-postmortem', 'no-sql-history']
+ valid_flags = ['debug-exit', 'pdb-postmortem', 'no-sql-history',
+ 'no-scroll-filtering']
if flag in valid_flags:
return flag
diff --git a/tests/end2end/features/test_marks_bdd.py b/tests/end2end/features/test_marks_bdd.py
index 5b8e352dd..5d31298ff 100644
--- a/tests/end2end/features/test_marks_bdd.py
+++ b/tests/end2end/features/test_marks_bdd.py
@@ -17,10 +17,19 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see .
+import pytest
+
import pytest_bdd as bdd
bdd.scenarios('marks.feature')
+@pytest.fixture(autouse=True)
+def turn_on_scroll_logging(quteproc):
+ """Make sure all scrolling changes are logged."""
+ quteproc.send_cmd(":debug-pyeval -q objreg.get('args')."
+ "debug_flags.append('no-scroll-filtering')")
+
+
@bdd.then(bdd.parsers.parse("the page should be scrolled to {x} {y}"))
def check_y(request, quteproc, x, y):
data = quteproc.get_session()
diff --git a/tests/end2end/features/test_scroll_bdd.py b/tests/end2end/features/test_scroll_bdd.py
index 69199ebf3..966d5c9bb 100644
--- a/tests/end2end/features/test_scroll_bdd.py
+++ b/tests/end2end/features/test_scroll_bdd.py
@@ -17,5 +17,14 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see .
+import pytest
+
import pytest_bdd as bdd
bdd.scenarios('scroll.feature')
+
+
+@pytest.fixture(autouse=True)
+def turn_on_scroll_logging(quteproc):
+ """Make sure all scrolling changes are logged."""
+ quteproc.send_cmd(":debug-pyeval -q objreg.get('args')."
+ "debug_flags.append('no-scroll-filtering')")