diff options
Diffstat (limited to 'e2e/ambassador/src/content/scrolls.js')
-rw-r--r-- | e2e/ambassador/src/content/scrolls.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/e2e/ambassador/src/content/scrolls.js b/e2e/ambassador/src/content/scrolls.js new file mode 100644 index 0000000..4227cf7 --- /dev/null +++ b/e2e/ambassador/src/content/scrolls.js @@ -0,0 +1,20 @@ +const get = () => { + let element = document.documentElement; + return { + xMax: element.scrollWidth - element.clientWidth, + yMax: element.scrollHeight - element.clientHeight, + x: element.scrollLeft, + y: element.scrollTop, + frameWidth: element.clientWidth, + frameHeight: element.clientHeight, + }; +}; + +const set = (x, y) => { + let element = document.documentElement; + element.scrollLeft = x; + element.scrollTop = y; + return get(); +}; + +export { get, set }; |