imacros find how much a scrollbar is scrolled

2019-09-12 09:58发布

SITUATION: I am trying to make an imacro that will measure how much a scrollbar is scrolled on a specific page, though I have had various difficulties:

The following javascript code is often used for this purpose:

var vertical = document.getElementById("myDIV").scrollTop;
alert("amount scrolled vertically: " + vertical);

ATTEMPT#1:

However, when I tried using that code in the firefox imacros extension in a js file, I get the following error:

ReferenceError: document is not defined, line 1 (Error code: -991)

code that produces the error:

var info = document.getElementById("myDIV").scrollTop;
alert("info");

ATTEMPT#2:

So what I tried next was the following code:

var info = window.content.document.getElementById("myDIV").scrollTop;
alert("info");

but that gives the following error:

Error: Accessing content window is not supported in multiprocess Firefox, line 208 (Error code: -991)

QUESTION: Is there a way for me to measure the amount scrolled in the firefox imacros extension? And if so, how? I have sadly been stuck on this for the past few days.

标签: imacros
1条回答
Lonely孤独者°
2楼-- · 2019-09-12 10:28

You are on the right track. Use imacros 8.9.7 version. You can find it here. https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/versions/

查看更多
登录 后发表回答