Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to have safari 4 on Mac OS X to reload a web page every N minutes on a per tab basis?

share|improve this question
    
Use Safari 4 to download FireFox. Use FireFox to install the autoreload extension. –  TheTXI Aug 7 '09 at 15:32
4  
@TheTXI: BOOOO! (That will have to suffice without comment downvoting.) –  arathorn Aug 7 '09 at 15:40
    
Is someone trying to cheat on their woot!/enthusiast badge? ;-) –  Kyle Cronin Aug 7 '09 at 18:03
    
@TheTXI: of course this is not a solution... –  AlberT Aug 11 '09 at 14:50
add comment

4 Answers 4

Just use a bookmarklet(a chunk of JavaScript that you can add to your bookmarks). Here's one that I found ages ago and it's served me well:

javascript:(function(p){open('','',p).document.write('%3Cbody%20id=1%3E%3Cnobr%20id=2%3E%3C/nobr%3E%3Chr%3E%3Cnobr%20id=3%3E%3C/nobr%3E%3Chr%3E%3Ca%20href=%22#%22onclick=%22return!(c=t)%22%3EForce%3C/a%3E%3Cscript%3Efunction%20i(n){return%20d.getElementById(n)}function%20z(){c+=0.2;if(c%3E=t){c=0;e.location=u;r++}x()}function%20x(){s=t-Math.floor(c);m=Math.floor(s/60);s-=m*60;i(1).style.backgroundColor=(r==0||c/t%3E2/3?%22fcc%22:c/t%3C1/3?%22cfc%22:%22ffc%22);i(2).innerHTML=%22Reloads:%20%22+r;i(3).innerHTML=%22Time:%20%22+m+%22:%22+(s%3C10?%220%22+s:s)}c=r=0;d=document;e=opener.top;u=prompt(%22URL%22,e.location.href);t=u?prompt(%22Seconds%22,60):0;setInterval(%22z()%22,200);if(!t){window.close()}%3C/script%3E%3C/body%3E')})('status=0,scrollbars=0,width=100,height=115,left=1,top=1')

And here's an edited version of this bookmarklet that removes the URL prompt and just uses the URL of the current tab:

javascript:(function(p){open('','',p).document.write('%3Cbody%20id=1%3E%3Cnobr%20id=2%3E%3C/nobr%3E%3Chr%3E%3Cnobr%20id=3%3E%3C/nobr%3E%3Chr%3E%3Ca%20href=%22#%22onclick=%22return!(c=t)%22%3EForce%3C/a%3E%3Cscript%3Efunction%20i(n){return%20d.getElementById(n)}function%20z(){c+=0.2;if(c%3E=t){c=0;e.location=u;r++}x()}function%20x(){s=t-Math.floor(c);m=Math.floor(s/60);s-=m*60;i(1).style.backgroundColor=(r==0||c/t%3E2/3?%22fcc%22:c/t%3C1/3?%22cfc%22:%22ffc%22);i(2).innerHTML=%22Reloads:%20%22+r;i(3).innerHTML=%22Time:%20%22+m+%22:%22+(s%3C10?%220%22+s:s)}c=r=0;d=document;e=opener.top;u=e.location.href;t=u?prompt(%22Seconds%22,60):0;setInterval(%22z()%22,200);if(!t){window.close()}%3C/script%3E%3C/body%3E')})('status=0,scrollbars=0,width=100,height=115,left=1,top=1')
share|improve this answer
    
Uhm, nice trick. It opens in a new tab the counter. It works, but the additional tab opened is quite annoying, is it possible to avoid its creation and do it all in a single tab? +1 for your answer –  AlberT Aug 25 '09 at 18:07
    
The bookmarklet tries to open a tiny window to manage reloading (that's easier to hide than a tab). Do you have any Safari addons that could be forcing it into a tab? The bookmarklet has to maintain a presence somewhere, because when a page is reloaded any JavaScript that's running on it is destroyed as well. One could write a bookmarklet that embeds the page in an iframe, but that would be replicating the functionality of a site like PAGE REBOOT (mentioned by nik). –  Sidnicious Aug 26 '09 at 18:32
    
yes, used tinkertool –  AlberT Aug 27 '09 at 9:29
add comment

Safari Page Monitor.

This configurable AppleScript keeps an eye on one or more web pages through Safari, reloading them at specified intervals and reporting any changes it detects, both verbally and through a session log file.

The developer explains “I wrote this script to keep tabs on my brother’s home page after they had had their first baby and started posting pictures. I remembered a page-monitoring feature in the Classic version of Internet Explorer and decided Safari needed something comparable”.


That link does not seem to work these days...
There is an on-line alternative (unless you want to write the plugin again).


Just be careful how and where you use this.

share|improve this answer
    
I already had found it googling, but I wasn't able to find a place where to download it ... everything I found leads to the unavailable main site of the author ;( –  AlberT Aug 11 '09 at 14:49
add comment

You can use an AppleScript to do this. Here’s how to reload every open tab every 5 seconds:

tell application "Safari"
    repeat
        repeat with aTab in (every tab of every window)
            set URL of aTab to (URL of aTab)
        end repeat
        delay 5
    end repeat
end tell

You can do some filtering inside the repeat with aTab block to only refresh certain tabs (predicated on the URL, title, etc.).

share|improve this answer
add comment

If you've upgraded to Safari 5 in the meantime, Apple added browser extensions. I made one that does just what you asked.

You can take a look at it here: Auto Refresh

Use Auto Refresh to set Safari to automatically reload on its own. Perfect for web development and monitoring online auctions, announcements and news.

share|improve this answer
add comment

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.