All I am hoping a Greasemonkey expert can help me here. I'm sure there's something I'm just really ignorant about but Greasemonkey (via jQuery) 2.0 has seriously broken my script in that the script is unable to click ANY element in the web page it's watching. It sees the elements fine but when attempting to .click() the element Greasemonkey fails with an unable to access property .length error (while pointing at jQuery).
I've narrowed this down and can represent it in a simple script (below).. Anyone that can offer me a pointer as to how / what I need to cloneInto or otherwise do to get permission for jQuery to click it would be appreciated. A copy of the sample script can be reached here: http://hithuntheal.com/x.user.js (also inserted/pasted below) It acts on the following URL which is a simple web page with a button on it... http://hithuntheal.com/x.php This sample script simply attempts to click the button. It works fine in Greasemonkey 1.5 and below. Even in GM2.0 it finds the button -- it can see the button's properties. But it can't click the button as jQuery ends with an error saying it cannot access property length. Now... If I remove the @grant lines (which I actually need because this is a cross domain script and needs cross domain storage) and replace the @grant lines with //@grant none then this script will work just fine in 2.0. But of course then I can't use GM_ functions. This is what's confusing me. I'm not doing anything exotic in this script. I'm clicking a button. jQuery can see the button, it can get properties from the button. It simply can't click the button. Any pointers one can offer me regarding GM2.0 and it's changes would be much appreciated! // ==UserScript== // @name TEST CLICK BUTTON // @namespace http://hithuntheal.com/x.user.js // @description Hitlist hunt heal and level combined // @grant GM_setValue // @grant GM_getValue // @include *hithuntheal.com/* // @icon http://www.hithuntheal.com/hhhicon.ico // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js // ==/UserScript== jQuery(".formInputButton").each(function(index) { var thisvalue=$(this).attr('value'); if (thisvalue="Finish Job") { alert('found button !: '+thisvalue); $(this).click(); } }); -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/greasemonkey-users. For more options, visit https://groups.google.com/d/optout.
