Thursday, October 15, 2009

Chrome Extension: Auto-Reload

IMPORTANT:  I've sold this extension. I no longer maintain it.

I've crafted an extension for Google Chrome: Auto-Reload. The extension enables automatic interval based page reloading.
This capability can be useful when developing web applications or just for the anxious folks waiting for a reply on a forum...
The extension can be installed by following this link (Chrome Gallery). Usage is simple: just press the "blue" button in the address bar to enable auto-reloading (the button will turn green when enabled). For more information, follow the extension's link to the gallery.

UPDATED: This extension is now hosted on the Google Chrome Gallery. Follow the above link.
UPDATED: The extension's project code home page is now located on GitHub at this link.
UPDATED:  The work currently on my plate for this extension can be viewed here.


UPDATED: The latest version information can be found on the extension's page here.


Latest Release: 7.6

  • Includes "per-URL" customization: uses the "context-menu" available through right-click

Release: 6.6

  • Sticky Mode : keep auto-reload status across page close
    • Allows a page configured as "Chrome Application" to auto-reload continuously
    • Use the "Create Application Shortcuts" menu item to configure 
  • Timeout & Randomize manual value editing (i.e. not only with "slider")
Suggestions Welcome!

67 comments:

  1. How do you configure the timing on the auto-reload?

    ReplyDelete
  2. Hi Andrew - you can't configure the interval on the latest version of the extension unfortunately. Google is removing the "toolstrips" functionality as so it is difficult to provide a UI to configure parameters. I'll figure out a way. Stay tuned! Cheers.

    ReplyDelete
  3. What is the current interval. Would this work well for a Woot-Off?

    ReplyDelete
  4. The current interval is 30seconds.

    ReplyDelete
  5. You can use "Browser actions" right? I've used it and it's pretty damn easy. You just only have to change the extension manifest file and do some tweaks to make plugin look better. And is it okay with you to share the source code of the plugin with us? probably get it uploaded to the Chromium-extensions google group?

    Thanks.

    ReplyDelete
  6. "Browser Actions" should be used to facilities scoped at the browser level: this extension's scope is the tab level.

    You can always look at the source code of a Chrome extension: just change the file extension from .crx to .zip and unzip the file...

    ReplyDelete
  7. Will you add a way to customize the reload interval?

    ReplyDelete
  8. I get this error: Invalid value for 'permissions[0].


    What do I need to do so I can install it?

    ReplyDelete
  9. @Johnny: Yes I'll be adding customization options in the near future - Stay tuned!

    ReplyDelete
  10. @Billie: Which dev release are you running? I believe this extension will only work with >= 4.0.222.0.

    ReplyDelete
  11. Version 5 with Timeout customization is available!

    ReplyDelete
  12. this extension will reload all open tabs? or just user selected tabs?

    ReplyDelete
  13. okay I found the answer.. i didn't realize there's a refresh icon at the address bar.. so it's only refresh selected tabs..

    ReplyDelete
  14. Excellent extension, thank you. This was one of the few useful things I was genuinely missing after the transition To Chrome from Firefox.

    ReplyDelete
  15. It seems the Chromium devs have broken a great deal of extensions by preventing file:// in content scripts. Apparently it wasn't considered secure.

    ReplyDelete
  16. Feature request: The ability to set a different timer variable per tab. A nice way to do this would be by right clicking the reload icon.

    ReplyDelete
  17. @flebbet: I am definitely interested in implementing "per-page" parameters but I am waiting on this "bug": http://code.google.com/p/chromium/issues/detail?id=28948 . Anyone interested can just "star" this "bug" too: this helps the prioritization process on the Chrome team. Stay tuned!

    ReplyDelete
  18. Hi Jean-Lou Dupont,
    I did what you suggested and 'unzipped' the extension. I changed the line 'var inter=30*1000;' in content.js to be 'var inter=300*1000;' so it refreshes every 5 mins, then re-zipped it.

    Now when I try to install it, I get 'bad magic number' coming up.
    What am I doing wrong?

    My Chrome version is 4.0.249.30 if that helps.

    ReplyDelete
  19. @Jinxx: use the latest version available through the download link at the top of this post: you'll be able to get up to 1hour. Alternatively, you can use the "load unpacked extension" option in chrome://extensions/

    ReplyDelete
  20. I like of this extension, but will be really good if you put a update key (example: CTRL+F12) to reload extensions on the need.

    Bye

    ReplyDelete
  21. @Nerdinho: I don't understand what you are asking: could you clarify? If you want to reload a "tab", there is also "CTRL+R" but I am guessing that's not what you want, is it?

    ReplyDelete
  22. Thanks very much. I look forward to more control.
    Regards.

    ReplyDelete
  23. Is there a way to set the default auto refresh under thirty seconds. I have found the options but the setting only goes down to 30 seconds. There is one particular website that I need to refresh on an almost continuous basis. If this is not possible now will it be in a future version and approximately how soon? Thanks and great add on!

    ReplyDelete
  24. @counselorsuzie: the only way at the moment would be to edit the code yourself. This feature has been asked to me twice so on the next release I plan on include it. Stay tuned!

    ReplyDelete
  25. Hey, I love your Auto reload program...thanks so much for writing it :) I can post a step by step to change the reload rate if anyone wants it...I just changed my rate today to 3 seconds :)

    My problem is the keys and values don't seem to display in windows 7 when I open the developer tools...can anyone else verify this problem or suggest a fix?

    ReplyDelete
  26. Icon does not show up when website is temporarily down.
    Also please check my comment on your chrome extension page, if you have not done it yet. TY

    ReplyDelete
  27. @Stephanie: (1) I will enable refresh rate downto 3seconds in the next release. (2) As far as your Windows 7 issue: I can't answer... I don't even have a Windows box anymore.

    ReplyDelete
  28. @rEnr3n : (1) randomization feature is already present: I am not sure what you are asking. Could you elaborate? (2) Support for when the target website is down: interesting feature... adding it to my "todo" list. Cheers!

    ReplyDelete
  29. Release 6.3 is out with minimal interval of 3seconds now supported (defaults to 60seconds).

    ReplyDelete
  30. Can you provide a detailed explanation on the randomize feature? I did some test with 3 seconds on timer and 100% randomize. And the page I am testing is reloading not more than 10 seconds. It's usually 5 - 8 seconds.
    I'm kind of confused about it.

    ReplyDelete
  31. base_interval + (base_interval * random()) where random is between 0 and 1.

    ReplyDelete
  32. Example:
    base_interval = 3 (user defined)
    end_interval = 60 (user defined)


    random() -where random is between base_interval and end_interval


    The output would look like 6, 40, 3, 25, 60, 12, 15, 33, 59, 48 and so on. I don't know what the code would really look like but that is the main idea.

    I just got a question about the code you posted, The random() will get a value of 0 and 1 only (no 0.1, 0.5, etc). Am I right?
    If so, the minimum value I would get is the base_interval and the maximum value is twice the base_interval. It's not really random IMO.

    I'm sorry for all the trouble I'm causing you. I'm really looking forward to this. ^_^

    ReplyDelete
  33. @rEnr3n: why don't you look at the code directly: http://github.com/jldupont/chrome-auto-reload/blob/master/src/content.js and see if it answers your question?

    ReplyDelete
  34. just wanted to say thanks for the extension. Simple but useful.

    ReplyDelete
  35. Getting an error trying to install:

    Could not load extension icon 'reload-24-off.png'.

    ReplyDelete
  36. Disables itself after first reload.

    I have not messed with the time range stuff. But for some reason it turns off after it reloads oncee. How can I fix this?

    ReplyDelete
  37. @Anon: if the page loads with errors (check the developer console for JS exception), then it might not work. I do not have control over this in the extension code.

    ReplyDelete
  38. I found when I selected "time range" and adjusted the time that it will keep refreshing. The only thing is I cannot go lower than "7" on the first setting. The second I am able to go all the way to 24.

    ReplyDelete
  39. This comment has been removed by the author.

    ReplyDelete
  40. I set everything up but not seeing it refresh at all...

    ReplyDelete
  41. This would be even more useful if there was a way to activate it for web pages that you turn into an "application" in Chrome.

    ReplyDelete
  42. @Anonymous: What do you mean by "application in Chrome"? Please provide more details.

    ReplyDelete
  43. in the "Control the Current Page" menu (looks like piece of paper in upper right), then select "Create Application Shortcut..."

    This makes an app-ized shortcut on desktop that opens without controls, tabs, and address bar. (basically just web page/app in a window)

    I run several info pages like this (kinda like poor man's widget) and I have to right-click to reload page manually.

    ReplyDelete
  44. @Anonymous : interesting... thanks for sharing! I just checked the "app file" that Chrome generates. The only way I could think of to make this work would be to introduce another feature: "sticky reload". This setting would be stored in the "localstorage" as to be always available i.e. either through a normal page view or when the "app" in question is launched. The drawback of course being that another address bar button would be required...

    ReplyDelete
  45. Thank you sir Dupont for creating this extension. I got a suggestion for the timeout interval, can you set it as a text box instead of the scroll bar? So we can enter the exact seconds? Because I find that I can only choose from 3sec then jump to 22sec to 44sec...etc. Thanks.

    I am used to Opera's build-in auto refresh, which lets you select from 5sec, 15, 30, 1min, 2, 5, 15, and 30mins. I believe those are more practical intervals.

    ReplyDelete
  46. @Anonymous: "Application Shortcuts" is now supported through the "sticky mode". Enjoy!

    ReplyDelete
  47. @Andy: parameters can now be edited manually i.e. no need to touch slider if you wish.

    ReplyDelete
  48. Great extension, would be even better if it supported POST data.
    Any plans to support POST data?

    ReplyDelete
  49. @Anonymous: how would this work? Find the first form on the page and issue a "submit()" on it?

    ReplyDelete
  50. Hey Jean,

    Really awesome work you have been doing. Please ii need urgent help. I am using the chromereload extension. I just need help with one thing.

    Is there a way that when the page is refreshed and a new post is availible, a sound is made? because one cannot conituosly look at the screen and do nothing. SO kind of an alert that a new post is avaible. any thing like that

    please reply soon.. awiting

    ReplyDelete
  51. @Ak@sh: I don't know about "chromereload" but for my extension "auto-reload", please vote for new features using the "Google Moderator" (see top of page).

    To detect a "new post", one would need to know what to look for on the page. This process is "site dependent" and thus not within the scope of this extension.

    ReplyDelete
  52. I am unable to change the time interval or get to the options. I just have the button and that is it

    ReplyDelete
  53. @Bijan: Use Chrome's Extension management page under "Tools -> Extension".

    ReplyDelete
  54. hello Jean-Lou Dupont,
    it`s a great extension, i like it. Thanks for sharing it .
    but is it possible to start the extension by skript?
    for example: i have a skript wich opens chrome with 2 sites. both sites should autoreload. so i have to klick the button, is it possible to start autoreload without klicking ?

    greatings from Germany

    Andrew

    ReplyDelete
  55. @linus-johannes: can't you use the "sticky" mode? Once the sticky mode is enabled on a page, then the page will auto-reload every time a browser tab is opened for this page. Thus, if you really need a script to launch a browser tab (really easy using Python BTW), then you just have to configure the "sticky" mode on the target page prior to using the script.

    ReplyDelete
  56. Just installed this extension. Going under Tools->Extensions I can find the extension - but there isn't an "Options" selection. Just enable/disable and incognito.

    How do I turn this on for one tab - but not another?

    ReplyDelete
  57. @Clint: which version of Chrome are you using? It seems it is not a recent enough version.

    ReplyDelete
  58. Excellent extension! Very handy for us tab-junkies! Thank you very much for the awesome work.

    To be fully rid of Firefox, I just need ASNumbers and Y-Slow (and Firebug) :)

    ReplyDelete
  59. Is there anyway to view the settings, particularly for tabs that have been setup for "sticky" auto-reload?

    ReplyDelete
  60. @Nunzio: with >V7.x, you can view the "per-URL" setting through right-clicking in the corresponding tab. If you are looking for an "admin view" of all the tabs, view in 1 place, maybe you could suggest this feature and describe a rationale for it?

    ReplyDelete
  61. Hi Jean-Lou
    I am trying to individualise refresh rates for different tabs (urls). I have tried doing as stated above :

    "- per-URL configuration using 'context-menus' ( i.e. right-click mouse button ) "

    But the same refresh rate is applied to all tabs, even across different Chrome window sessions.

    Any help ?

    tia

    ReplyDelete
  62. Would it be possible to enhance this extension to also block reloads initiated from the page itself? I'm trying to avoid automatic reloads on online newspaper sites.

    ReplyDelete
  63. @Tor: This feature is out of focus for this extension.

    ReplyDelete
  64. Greetings,

    Thank you for this awesome extension. There is only one thing I have not been able to find that's been preventing me from making my RAM happy and ditching Firefox and one of it's auto-reload scripts.

    For work I monitor a page that does not reload on its own, and requires me to press keys every so often to sort incoming e-mail. On Firefox I have it set to reload every 3 minutes, and it continues to reload even if a key is pressed. For what I need, this is perfect as it's only one key at a time and I do not have to fill out forms.

    The key-press is require for me to sort the material on this page, but in your extension this causes the reload to disable. Which then means I have to remember to click the icon again to start reloading it once more. Is there a way, that I stupidly missed, to disable the "stop reloading on key-press" functionality of your extension?

    Thanks in advance!

    -Tim

    ReplyDelete
  65. @Timothy: there isn't a way to disable "stop on key press" functionality as of yet. Please be sure to visit the "Google Moderator" page to vote for this feature though :)

    ReplyDelete