Emanu2000 2 Posted February 11, 2016 Report Share Posted February 11, 2016 (edited) Hello everyone, I'm new here ... I would like to help with a command "define". I have a button on a html panel, which runs a script of a "define". what happens is that the first time I press the button, everything is perfect, however when I press the button again it does not run correctly, I do not know if I need to stop the script with a "return" or if there is a command to reset the define ?, is some kind of cache? I do not know what else to do. Edited February 11, 2016 by Emanu2000 Quote Link to post Share on other sites
pash 504 Posted February 11, 2016 Report Share Posted February 11, 2016 not sure you codetry ui html panel("<button name=\"replacethis\" onclick=\"ubot.runScript(\'Search Google\')\">BUTTON 1</button>",200) define Search Google { alert("Hi") }it work all time? Quote Link to post Share on other sites
Emanu2000 2 Posted February 11, 2016 Author Report Share Posted February 11, 2016 (edited) I think what may be happening is that my script is too long, and has detected that is after he runs a part where there are some interactions with elements in the browser, then he no longer works when it is activated for the second time. My script contains commands Some interaction with external windows system, such as sending files and I suspect that the problem can be when he goes through that part. Your example is simple and it works perfectly. Edited February 11, 2016 by Emanu2000 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 11, 2016 Report Share Posted February 11, 2016 You have to make sure the script contains everything it needs to run. Make sure it navigates to the correct page, clears lists if necessary and switches variables back to where they should be. Also you may want to make a true or false variable to see if the script is currently running to avoid issues. Only continue to run the script if the variable is set to false (or true, whatever you want it to be set as). Quote Link to post Share on other sites
Emanu2000 2 Posted February 12, 2016 Author Report Share Posted February 12, 2016 it's all right in my code, what I discovered is that the browser UBot (chrome 39) this freezing when my routine interacts with an ajax element on the page. from there he can not recognize any more element and interact with him only when they give a refresh by navigating to another page and then back to the page again, then the browser "unlock". thanks for the help of all, I believe it to be a bug in the browser, someone from the development team could do some tests with more "heavy" pages involving ajax elements to see if this problem persists. Quote Link to post Share on other sites
Varo 28 Posted February 13, 2016 Report Share Posted February 13, 2016 it's all right in my code, what I discovered is that the browser UBot (chrome 39) this freezing when my routine interacts with an ajax element on the page. from there he can not recognize any more element and interact with him only when they give a refresh by navigating to another page and then back to the page again, then the browser "unlock". thanks for the help of all, I believe it to be a bug in the browser, someone from the development team could do some tests with more "heavy" pages involving ajax elements to see if this problem persists. same problem here,You are right about navigating to another page to "unlock" the browser, but in my case sometimes it doesnt solve the problem. The browser still "lock" (document text are null/empty).Other solution that work for me is Reset Browser. But it reset everything include your login session. Lately i also found another solution, step by step below: 1. Identify all js that load on your page. Choose js that needed by the page, and ignore another js about tracking: like facebook event manager, google analytics, google tag manager, sociomantic, etc)2. Disable all js completely (Allow Javascript - No)3. Load the js locally in ubot (Run Javascript) after navigate to the page With this way, i can minimize the browser "lock"HTH Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.