imacros find how much a scrollbar is scrolled

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-07 04:45:28

问题


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/



来源:https://stackoverflow.com/questions/41636311/imacros-find-how-much-a-scrollbar-is-scrolled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!