See, the problem likely is that the page isnt actually reloading, its changing its content. Without seeing the siteâs full code, i couldnt tell you how.
The greasemonkey script would have to know when that happens, in order to fire the event a second time.
The code pasted above would still click that button, the id property hasnt changed so it would still find the button just fine.
Thanks. This site is advertisement site based on auto surf . first time the button âstart visitâ is loaded the your code works successfully and autosurf start to visit but when the ads is finished This message is appeared " due to completion of sites, your automated visit was successfully completed" the code does not work"
at this time (second time) button âstart visitâ does not clicked automatically by greasemonkey
Yeah, my guess is the system doesnt actually reload the page, it does some form of crossloading, modaling, or replacing to accomplish this, and as such the page isnt actually âloadingâ again, meaning the script will only fire once.
Looking at the translated text makes me pause though, and I have to ask; is it against the terms of service of the website youâre using to automate this operation?
No it is not against the terms of service of the site. beacause i can click manually on button" start visit" second time and the surf start successfully. i have 2 new idea.
1- can i use greasemonkey open url in specific time? in order to refresh page completely
2- i should install My Weekly Browsing Schedule add on in order to open site address on specific time.but this operation creates extra tabs a long time. then i should use âopen link in existing tab extensionâ in order to remove repeated tabs but this extension is for chrome not for firefox. is any add on similar this for firefox?
âOpen Link In Existing Tab Extensionâ is for chrome. Can i convert codes of this extension to Greasemonkey codes? In other hand Greasemonkey executes commands of this extension
I dont know if greasemonkey (or the browser) imposes limitations on GM scripts such as not being able to set the location object. Youâd have to look at greasemonkeyâs documentation.
location.assign() is a valid javascript command. Itâs⌠POSSIBLE that GM is not operating in the âwindowâ context space, so you might have to define it explicitly as window.location.assign()
IIRC Greasemonkey operates in a âsandboxâ and the script needs to intentionally and explicitly use âunsafeWindowâ. Itâs called unsafe for good reason. name clashes, global scope etc. all kinds of nasties to take into consideration. AFAIK it is usually relatively easy enough to work with the DOM (append elements, CSS etc.) but when script attempts to work with what is the browserâs, things get more tight for security reasons.
You should have seen an error message or three in the console. Do you?