Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am currently taking an online course offered by my school. Every time I log in I am taking to a terms of use agreement, and must accept it every single time I log into it.7

Is there anyway using something like a Greasemonkey script, automatically push the accept button when this appears. Generally is there such a way to press a button when a specific page/link is navigated to?

share|improve this question
    
It's not 100% automatic, but you could try iMacros? –  barrycarter Apr 1 '13 at 4:28

1 Answer 1

up vote 3 down vote accepted

I would write a simple jquery script and add includes to jquery from the CDN.

<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js" type="text/javascript">/script> 
<script type="text/javascript">
 $(function(){
     setTimeout(function() {
           $("a.NAMEOFTHEBUTTON").trigger('click');
        },10);
       });
</script>
share|improve this answer
    
Okay, I will give this a try. I never have actually made a Userscript with Chrome before, but I would be able to use this piece of code in one? Correct? –  Fogest Oct 22 '12 at 21:02
2  
One problem I realized, is that this is not checking the actual URL of the site. This means that any button with the same label as the one of the site I'm talking about, would also be autoclicked, which is not good. –  Fogest Oct 22 '12 at 21:42
2  
you'll have to add @include http://www.example.com/* to run it on specific site, replacing example.com with your site. For Chrome extensions, it has to be the match pattern developer.chrome.com/extensions/match_patterns.html –  Sathya Oct 23 '12 at 5:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.