Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-update scripts #1053

Closed
avindra opened this issue Oct 29, 2009 · 24 comments
Closed

Auto-update scripts #1053

avindra opened this issue Oct 29, 2009 · 24 comments
Milestone

Comments

@avindra
Copy link

avindra commented Oct 29, 2009

I searched, but didn't find this issue, other than the one here:

http://userscripts.uservoice.com/pages/795-general/suggestions/5436-auto-update-scripts

Which doesn't really make sense, because Jesse can't do anything for this.

Auto-update scripts; it's been a hotter topic than ever in userscripting, especially as greasemonkey is reaching more people. Jesse provides enough resources on userscripts.org to properly update any script from userscripts.org. It would be ultra-badass if script updating were given a similar look and feel to the Firefox add-on manager.

As for scripts not installed from userscripts.org, maybe you can flag it with a "manual update" flag, whereas scripts from US.o would be flagged for automatic updating.

What do you guys think?

@NV
Copy link

NV commented Oct 29, 2009

I agree.

As Greasemonkey user, now I use wescript.net for update scripts. It works, but it's another add-on. Not so many people know about it.

Look at Stylish add-on. It has "Find Updates" button Greasemonkey should learn from this.

@NV
Copy link

NV commented Nov 2, 2009

I see this issue has been labeled "0.9.x". Great!

GM needs UI for updating scripts.

Greasemonkey Script manager UI

What do you think about it?

@tim-smart
Copy link

This is also being discussed on Userscripts.org: http://userscripts.org/topics/48267

@sizzlemctwizzle
Copy link
Contributor

Well here's a start to solving this issue. This commit involves mostly changes to the GM core to support update checking and doesn't do anything to notify users of an available update. Specifics are in the commit message.

Update: I'm currently working on this feature in this branch. Any help would be greatly appreciated.

@sizzlemctwizzle
Copy link
Contributor

I finally got around to integrating recent upstream changes into my branch for this issue. So far the actual update checking works fairly well given the few tests that I've run. I've only been able to get some basic integration with the addons dialog working. On Firefox start up, if there are any updates that have been accumulated the addons dialog will open and display them for the user. You can install available updates via the context menu. I've made the "Find Updates" button filter the scripts list to show only scripts with available updates. Scripts that have an update have a little green exclamation mark next to them in the addons dialog.

@tim-smart
Copy link

Great work sizzle. I might flick though a few patches if I get some time off my other projects :)

@erikvold
Copy link
Contributor

For those interested I just implemented this feature for Scriptish, it's only for FF4 though, but it should help whomever works on this for GM.

@sizzlemctwizzle
Copy link
Contributor

I posted a progress update on this issue. Latest test build is here.

@forteller
Copy link

I'm sorry if it is redundant to mention this, but I just wanted to say that Stylish does a good job of using the same update system as Firefox uses to update extensions to also update their Userstyles. The same thing for Userscripts would be fantastic!

@sizzlemctwizzle
Copy link
Contributor

I just spent the last two hours resolving conflicts when I attempted to merge my updater branch with Greasemonkey 0.9.10. I haven't had a chance to test it yet and I also need to port this important commit from Scriptish. Also merging brought back the utils.js file by accident.

@arantius
Copy link
Collaborator

arantius commented Sep 8, 2011

Sorry I missed this for so long. I'm working on merging it. But as you pointed out, because of the time passed and the recent really large refactor, it's taking some work.

arantius/greasemonkey@master...issue-1053

@arantius
Copy link
Collaborator

@sizzlemctwizzle

Is your branch supposed to pop up an installation dialog, when installing an update? It does currently, and I'm thinking that's where the breakage I'm seeing is coming from.

@sizzlemctwizzle
Copy link
Contributor

No it's supposed to bypass the installation dialog since its an update and not a new install. It is also supposed to open the script manager on FF startup if there are available updates. That never worked perfectly so perhaps that is the cause of the breakage.

@arantius
Copy link
Collaborator

Ok. My previously linked branch is updated, and much more functional.

@sizzlemctwizzle
Copy link
Contributor

Okay, I just tried your branch in FF 6.0.2 and it managed to find an update for one of my scripts and I installed it. Very nice work. A few suggestions from my test experience:

  1. Make the progress indicator work(right now it stays empty until the script has installed) when downloading an update, or just hide it.
  2. When you enable/disable a script that has an update, it no longer shows an update is available until you reload the script manager.
  3. Open the Add-ons Manager to the "Updates" section when there are available script updates on Firefox startup. I know there is code in place to do this but it doesn't appear to be working. I'm gonna go try this in FF3.6 to see if it is a >= FF4 only issue.

Edit: Yeah the Add-ons Manager doesn't open on startup when updates are available in FF3.6 either. Also in FF3.6 I noticed:

  1. When a script shows that an update is available in the "User Script" view and you right click on it there is no option to install the update.
  2. When there is a script in the "Updates" view and you right click on it, the "Install Update" option doesn't work. However, clicking the "Install Updates" button in the lower right corner does work.

@arantius
Copy link
Collaborator

Make the progress indicator work(right now it stays empty until the script has installed) when downloading an update, or just hide it.

I agree it would be very nice. But it's hard. Code plumbing aside, we don't actually know how much will be downloaded: you've got the main script, then any number of requires and resources it defines. The latter you don't know until the script is downloaded.

When you enable/disable a script that has an update, it no longer shows an update is available until you reload the script manager.

Hm. Will have to test!

Open the Add-ons Manager to the "Updates" section when there are available script updates on Firefox startup.

Why would there "be available updates"? I rather think that if it's been discovered automatically, it should be installed automatically. Firefox even does this with extensions now, with the caveat that you have to restart Firefox for them to really be installed (but if you do restart, they are installed, silently).

@arantius
Copy link
Collaborator

All that aside: I think it might well be time to merge this into master, and start tracking all these little issues in their own tickets so they don't get lost track of.

@cletusc
Copy link
Contributor

cletusc commented Sep 19, 2011

if it's been discovered automatically, it should be installed automatically. Firefox even does this with extensions now

As with extensions, you should have the option to disable update checking on a per-script basis (if it hasn't already been implemented).

@arantius
Copy link
Collaborator

On Mon Sep 19 19:36:42 2011, Ryan Chatham wrote:

As with extensions, you should have the option to disable update checking on a per-script basis (if it hasn't already been implemented).

Has not been implemented, but agreed. There's a simple workaround:
download and install from a file (update URL is now just install URL).
But implementing this feature should be dead easy, too.

@arantius
Copy link
Collaborator

I've decided that for 0.9.12 this feature will be included, but disabled by default. Therefore it won't do anything unless you manually check for, and apply, updates. We'll work out the remaining warts in the future (and in following tickets), and when it's ready, turn it on for everyone.

@arantius
Copy link
Collaborator

Created a pile of separate smaller issues, all in 0.9.13, to improve this feature:
https://github.com/greasemonkey/greasemonkey/issues?milestone=28&state=open

@signe
Copy link

signe commented Oct 6, 2011

It'd be great if there was something explaining how a script can be configured for updating. There's zero documentation, and reading over this bug doesn't really shed any light. Is there a new "source" parameter in the header, or something?

@arantius
Copy link
Collaborator

arantius commented Oct 6, 2011

Things are still under development and docs will be coming. But for now it's as simple as the @Version header. If a script at the same URL which the installed script was installed from has a higher @Version, then it will update. We use nsIVersionComparator and thus its definition of what version is "higher" than another.

@sizzlemctwizzle
Copy link
Contributor

@signe

As arantius explains, you don't need to do anything special to your script to enable updating besides setting and incrementing the @version value. Greasemonkey keeps track of the url from which a script was downloaded (it has done this since 0.9.0 in anticipation of this feature) and by default uses this to check for an update (i.e. where we parse the @version value and compare it the version number of the installed script) and install the update. You can use the @updateURL metadata key to manually set where you want Greasemonkey to check for updates. This lets you upload just the metadata of a script to a separate url to save bandwidth. You can also use @installURL to manually set where you want updates to install from. I hope that clears a few things up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants