admin管理员组文章数量:1410688
There is a button in the web page as
<input class="button" type="submit" value="new">
I need a greasemonkey script which even before the page pletely loads must automatically click on the button and move to next page.
Thanks.
There is a button in the web page as
<input class="button" type="submit" value="new">
I need a greasemonkey script which even before the page pletely loads must automatically click on the button and move to next page.
Thanks.
Share Improve this question asked Jun 15, 2010 at 17:56 technocrattechnocrat 7355 gold badges13 silver badges23 bronze badges1 Answer
Reset to default 4I need a greasemonkey script which even before the page pletely loads must automatically click on the button and move to next page.
With Greasemonkey, you currently can only run a user script on DOM ready which is just before the page load is plete.
With user scripts used on Google Chrome they can run sooner, and eventually you will be able to run userscripts before DOM ready.
As for the code to select and click that button:
document.evaluate("//input[@value='new' and @type='submit' and contains(@class, 'button')]", document, null, 9, null).singleNodeValue.click();
should do the trick
本文标签: javascriptclick a button automatically using greasemonkeyStack Overflow
版权声明:本文标题:javascript - click a button automatically using greasemonkey - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744803306a2625991.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论