aboutsummaryrefslogtreecommitdiff
path: root/e2e/ambassador/src/content/scrolls.js
diff options
context:
space:
mode:
Diffstat (limited to 'e2e/ambassador/src/content/scrolls.js')
-rw-r--r--e2e/ambassador/src/content/scrolls.js18
1 files changed, 18 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..79be01d
--- /dev/null
+++ b/e2e/ambassador/src/content/scrolls.js
@@ -0,0 +1,18 @@
+const get = () => {
+ let element = document.documentElement;
+ return {
+ xMax: element.scrollWidth - element.clientWidth,
+ yMax: element.scrollHeight - element.clientHeight,
+ x: element.scrollLeft,
+ y: element.scrollTop,
+ };
+};
+
+const set = (x, y) => {
+ let element = document.documentElement;
+ element.scrollLeft = x;
+ element.scrollTop = y;
+ return get();
+};
+
+export { get, set };