diff --git a/qutebrowser/javascript/scroll.js b/qutebrowser/javascript/scroll.js index fa0f311b3..9da413136 100644 --- a/qutebrowser/javascript/scroll.js +++ b/qutebrowser/javascript/scroll.js @@ -61,12 +61,13 @@ window._qutebrowser.scroll = (function() { funcs.pos = function() { var elem = document.documentElement; + var body = document.body; var pos = { "px": {"x": window.scrollX, "y": window.scrollY}, "scroll": { - "width": elem.scrollWidth, - "height": elem.scrollHeight, + "width": Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth), + "height": Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight), }, "inner": { "width": window.innerWidth,