imacros find how much a scrollbar is scrolled

2019-09-12 10:45发布

问题:

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.

回答1:

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/



标签: imacros