Updater in Greasemonkey core

in Userscripts.org discussion
Subscribe to Updater in Greasemonkey core 38 posts, 6 voices



Tim Smart Scriptwright
FirefoxMacintosh

Right, it is very overdue, and in essence it is a simple feature to implement. But getting it right the first time is what I am all about, so I want some thoughts from you guys about the end result. I got the following questions, and my (current) answers:

  • Where do we show the updates?

    • At present, I think we should treat Userscripts with the same priority as Add-ons, and show them in the Add-ons update tab.
  • What version number do we compare to, and fallbacks?

    • I think in this order: .meta.js and @uso:version, @version diff, lastly a simple script diff
  • Update frequency
    • I think whatever Mozilla currently uses would be ideal. I will have a look at their add-on update implementation as part of the process.
  • Security?
    • I think, like Firefox, that we should only update from https URI's
    • Disabled by default?

Thoughts and opinions? Things I have missed?

 
lazyttrick Scriptwright
FirefoxWindows

1. It'd be cool to show updates that way. Also a button to install all updates without requiring interaction, as in add-ons updates. Each script could have an option to check updates or not(default probably not).

2. I think uso:version is ok, maybe uso:hash if something fails, though I'm not sure uso:hash works as I suppose. I once considered monitoring scripts installed outside of Userscripts.org in my updater, could be an use for diff. But I'm not sure about the implications.

3. An option to customize the update interval, since some users have tons of scripts installed, and some scripts are modified frequently.

Clicking Tools > Add-ons there's Themes, Plugins, there could be one for Userscripts. Probably the same content of current script manager, or maybe modified to fit the style of the others. This extra location for the script manager wouldn't be absolutely necessary, but it could make sense for new users seeing them in that context of add-ons, plugins, etc...

 
Marti Scriptwright
FirefoxX11

Tim Smart wrote:
But getting it right the first time is what I am all about, so I want some thoughts from you guys about the end result.
Right Tim... you leave projects unfinished and have no focus. This request should probably be made upstream although in your lack of wisdom in the past you have come up with some wares that could be used elsewhere at some point so I won't be knocking any ideas presented... but your unreliability makes you unsuitable for the task as you have so constantly proven in the past.

I don't know what is wrong with you right now, but you really need to focus more on your issues rather than someone elses like upstreams. Your deletion of support for USO Updater is noted by the deletion of your guide. Your lack of finishing any proposed API is also noted like the GM_parser.

I hope your venture pans out and I'll be there along with others to pick up the pieces as usual... you have potential but absolutely no initiative and a serious lack of knowledge when it comes to Security... hopefully you'll improve as time goes by and leave the the ego and subtle hostilities behind. This message comes from my entire team here and is put as nicely as we can say it. :)

Tim Smart wrote in a pm:
I was going to reply in the topic, quote me if you want, but I did say previously conversations with you go off topic fast.

About the GM_parse API… Since when did I stop working on that? I have been playing with it the last few days. If you want to chat about that, for sure.

USO Updater was finished a long time ago, you probably mean the documentation was never finished? I deleted the guide because it was irrelevant and out-dated, so USO Updater is now a documentation-less updater, apart from annotated source code on GitHub.

And now you are doing what you accuse many other people of doing, ‘de-railing’ a topic. Seriously, me (and quite a few others I talk to here, and from other open source projects) don’t like your ‘karma’.

I do Greasemonkey for fun, I leave serious stuff for my day job. I write code in my spare time for others to enjoy, and getting into massive arguments about stupid little things is definitely not a enjoyable way to do open source.

You are endangering the Userscript community in my honest opinion, if people come here and share code, and you start saying poking holes in their actions, you scare them away, and we lose contributors. Don’t scare people, mentor them. You say you pick up pieces, but you also didn’t mention that you like to create them.

Anyway, you can post quote this in the topic and de-rail it further if you want, but personal stuff should be kept out of open forums.

No Tim you are leaving thousands of users stranded by dropping support for your updater and it is an extremely poor choice. I've also stated before that I'm not here for a popularity contest like you are. I nurture my user base just fine but I'm also not stupid. This is all relevant topic conversation and someday you'll be wise enough to know the difference. I've also heard my share of your "karma" but I usually ignore it. The design decision to drop support on all of your user base is a mistake and your suggestions to make usoCheckup unsecure was flat out absurd.

Like I said before in this post, I wish you luck with your endeavors as you have potential... but you are too opininated, inexperienced and grossly negligent in some of your ideas. You've decided to make yourself an outcast to the N.O.T. and that is unfortunate and these things need to be made public. You are blocked from pm's as your intentions are questionable.

 
Tim Smart Scriptwright
FirefoxMacintosh

lazyttrick wrote:
1. It'd be cool to show updates that way. Also a button to install all updates without requiring interaction, as in add-ons updates. Each script could have an option to check updates or not(default probably not).

Yeah, I guess the cleaner it integrates into the Addons dialog the better, will have to look into the implementation Mozilla uses for add-ons, and see if they expose an API for the update system.

  1. I think uso:version is ok, maybe uso:hash if something fails, though I'm not sure uso:hash works as I suppose. I once considered monitoring scripts installed outside of Userscripts.org in my updater, could be an use for diff. But I'm not sure about the implications.

Well the reason we need fallbacks for uso:version, is due to some Userscripts not being hosted here on USO. So I guess this is where the most thought is needed, to ensure we can enable updater support for as many different scenarios as possible.

  1. An option to customize the update interval, since some users have tons of scripts installed, and some scripts are modified frequently.

Nice! As long as decent thresholds are set, this would be pretty cool. Otherwise we can settle on a default limit later on.

Clicking Tools > Add-ons there's Themes, Plugins, there could be one for Userscripts. Probably the same content of current script manager, or maybe modified to fit the style of the others.

Anthony (Greasemonkey developer) has already implemented a User Scripts tab for the Addons dialog, so that is one less thing to worry about :)

 
Marti Scriptwright
FirefoxX11

Tim Smart wrote:
Anothony... has already implemented a User Scripts tab for the Addons dialog
No he hasn't produced anything out of vaporware and you know this.

 
Tim Smart Scriptwright
FirefoxMacintosh

Marti wrote:
No he hasn't produced anything out of vaporware and you know this.

I was using it the other day, and it worked just fine. A few tweaks here and there, and we are cooking with gas.

Yeah sure, Anthony has his problems, so do you, so do I. I commend him for his work on the Addons tab, the necessary functionality is there.

 
Marti Scriptwright
FirefoxX11

Tim Smart wrote:
I was using it the other day, and it worked just fine.
I've been using it today and no it's not "fine".

 
Tim Smart Scriptwright
FirefoxMacintosh

Marti wrote:
I've been using it today and no it's not "fine".

OK, considering it wouldn't be in the scope of this topic, I have created a enhancement issue. Updater logic should plug into whatever is available.

 
Marti Scriptwright
FirefoxX11

Tim Smart wrote:
considering it wouldn't be in the scope of this topic, I have created a enhancement issue.
An semi-agreeable suggestion.

 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

Tim Smart wrote:
Also a button to install all updates without requiring interaction, as in add-ons updates.
This scares me a little. I often customize my scripts locally, and I'd hate for them all be overwritten by the click of a single button.
Tim Smart wrote:
Well the reason we need fallbacks for uso:version, is due to some Userscripts not being hosted here on USO.
I disagree. I don't think update checking should occur for any scripts that are installed from a source outside of Userscripts.org. Logically it is far too much of a hassle and this is an open site and pretty much the defacto standard for the publish of user scripts for Firefox. I do think @version should trump @uso:version like it does in my @require update checker.
Tim Smart wrote:
lazyttrick wrote:
3. An option to customize the update interval, since some users have tons of scripts installed, and some scripts are modified frequently.
Nice! As long as decent thresholds are set, this would be pretty cool. Otherwise we can settle on a default limit later on.
I agree as well.
Tim Smart wrote:
Anthony (Greasemonkey developer) has already implemented a User Scripts tab for the Addons dialog, so that is one less thing to worry about :)
If this pans out it would be very nice, but in the meantime I think we should come up with an implementation that involves the current user script manager. If Anthony does come through then we can worry about merging our updater with it then, but I'd be nice to not have to wait for the kinks in the new interface to be ironed out before the update checker can be released. Perhaps we can put a check for all updates option in the right-click monkey menu below Manage User Scripts, and then a check for update button for each individual script in the Manage Scripts dialog next to the Uninstall button.
lazyttrick wrote:
(default probably not).
I disagree and think checking should be done by default. I'd be annoying to have to make sure to enable update checking for each script I install, but maybe a master checkbox(to set the default of newly installed scripts) could be a compromise.
lazyttrick wrote:
3. An option to customize the update interval, since some users have tons of scripts installed, and some scripts are modified frequently.
I also think that update checking should only take place when a script has been included on the current page. It's annoying to have all scripts that have been updated prompt you to update all at once. Who cares if you have the latest version of a script if you never use it?

 
Tim Smart Scriptwright
FirefoxMacintosh

sizzlemctwizzlewrote:
This scares me a little.

It would obviously have to have some sort of confirmation :p

sizzlemctwizzle wrote:
I don't think update checking should occur for any scripts that are installed from a source outside of Userscripts.org.

Hmmm, it will be interesting to hear others opinions on this. I'm 50/50 for now, but supporting all scripts would be ideal.

sizzlemctwizzle wrote:
Perhaps we can put a check for all updates option in the right-click monkey menu below Manage User Scripts, and then a check for update button for each individual script in the Manage Scripts dialog next to the Uninstall button.

The menu idea sounds good, except I'm not sure how the current UI would work for showing updates :/ I guess some pondering will need to be done if we decide to hook it up to the current UI.

 
Marti Scriptwright
FirefoxX11

Tim Smart wrote:
It would obviously have to have some sort of confirmation :p
That's not what was stated... without interaction in my book means no confirmation.

Tim Smart wrote:
Hmmm, it will be interesting to hear others opinions on this
Unlikely... however this is not up to a single user here on USO... I have no idea what ties there are that are still active between USO and GM upstream and quite frankly it's not a top priority to determine this. I'm all for a single source for userscripts but I also know there will be people out there that want to host their own... Can't please everyone and I wouldn't expect GM to do that neither should you especially in your current state.

Tim Smart wrote:
I'm not sure how the current UI would work for showing updates
I do however it's Anthonys "baby" not ours... like I said earlier, I won't be knocking any ideas presented. If they are good then I'll support them... if they are horrible like your pastebin "progress" then I'll stand firm against it.

 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

Tim Smart wrote:
It would obviously have to have some sort of confirmation :p
I think you underestimate my stupidity. If the script asks me if I'd like to install all updates I'll likely think: "Sure that sounds reasonable," but as soon as I click the confirm link I'll realize what a horrible thing I have done. Trust me, I've done stupid shit like this before when prompted to install just one script and loose all the changes I've made
Tim Smart wrote:
but supporting all scripts would be ideal.
Ideal? Maybe. But at the moment I think focusing on getting the updater working correctly with Userscripts.org is more of a priority. The possible support for update checking scripts from other sites should be at most a future goal.
Tim Smart wrote:
except I'm not sure how the current UI would work for showing updates
There would definitely have to be some other separate UI mechanism to alert the user of new updates. I think something close to the way the prompt to install a JetPack is done. It's pretty unobtrusive, and the update alerts should be the least naggy as possible.

 
Tim Smart Scriptwright
FirefoxMacintosh

sizzlemctwizzle wrote:
If the script asks me if I'd like to install all updates

Ah! I probably didn't speak my mind well enough. It would be similar to Firefox's add-on updates, where it lists all the possible updates, with a tick box on each one, letting the user decide whether they want it installed or not. Sound good?

sizzlemctwizzle wrote:
I think something close to the way the prompt to install a JetPack is done.

/me re-installs Jetpack

 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

Tim Smart wrote:
with a tick box on each one... Sound good?
That sounds like it'd give me more protection from being stupid.

So are you thinking of checking for all updates* on Firefox startup? Or periodically during the session? Or do you like my idea of checking for updates when a script is included?

*when I say "check for updates" I mean: check if a predetermined amount of time has passed since the last check of the remote script's version and if so then actually check the remote script's version.

 
Tim Smart Scriptwright
FirefoxMacintosh

sizzlemctwizzle wrote:
checking for updates when a script is included?

Yeah I like that. So only when a script is 'executed'? That should make the implementation a bit cleaner also.

 
lazyttrick Scriptwright
FirefoxWindows

*sizzlemctwizzle's idea at first seems interesting, but imagine you visit 10 sites in sequence, 5 of them with updates... It would be annoying to have random updates popping up here and there. Just check them all at once. In my experience the updater goes through meta.js really fast. There's no need to worry about that.

*regarding modified scripts(sizzlemctwizzle), just make individual update buttons per script... but keep 1 button for update all scripts in 1 click: http://i.imgur.com/UYAcG.png .
I think the "update all" button is an essential feature, but it requires update script option defaulting to "no" because of the Greasemonkey confirmation policy. If you set it to "yes", you're assuming the risks when clicking "update all".

*Regarding scripts outside USO, there's 2 cases:
1. Script listed in USO but hosted outside: I never dealed with it, so I don't know how it works.
2. Script not listed in USO, hosted outside: in this case the developer could change the filename in future versions, so I think it's probably not worth to keep track.

 
Marti Scriptwright
FirefoxX11

lazyttrick wrote:
*sizzlemctwizzle's idea at first seems interesting, but imagine you visit 10 sites in sequence, 5 of them with updates... It would be annoying to have random updates popping up here and there. Just check them all at once.
In all wisdom it would be better to offer both types that any user would want... I personally don't want all my scripts updated all at the same time however occasionally I could tap the Find Updates when I want them all at once... I think a happy medium is possible to accommodate both methods and have them coexist... just like it is now.

 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

Marti wrote:
In all wisdom it would be better to offer both types that any user would want...
Exactly, I wasn't arguing my flavor of update checking as the only way, but I wanted it included in the mix to lighten the load of barking at the user for updates all at once. And we should definitely give users some amount of control over update checking no matter what method we go with.

When you have a lot of scripts installed it is over-whelming when an updater tells you a whole bunch have available updates. I'm talking big numbers here like 40 scripts that have updates. I've used lazyttrick's updater and this is the number one reason I don't use it currently. His updater even checks for updates of disabled scripts which is just stupid imo.

Perhaps we can keep track of when a script was last "executed" and keep a list with all the recently executed scripts at the top and those would be the ones we checked for updates together and prompted the user. Then we could leave the scripts that haven't been executed in a long time to be checked for updates at the moment they are actually executed. This would accomplish three goals:

  1. The prompt that shows the list of scripts that have updates would be relevant to that user. So they'd actually care that there are updates.
  2. Scripts that aren't used often would still get a chance to check for updates, when that user decides to use it.
  3. lazzyttrick's problem of visiting multiple sites that have scripts needing updates would be avoided.
  4. lazyttrick wrote:
    it requires update script option defaulting to "no"
    So you mean an option to avoid the GM user script install confirmation dialog when updating all scripts would be set to false by default? That sounds better than what I thought you were advocating before.

 
Tim Smart Scriptwright
FirefoxMacintosh

Maybe, just maybe, we could to the whole 'on execution' thing, except all it would do is see if an update is available, if so, push it to a stack / list, and change the monkey face icon. You could then "Show updates available" in the menu.

The only time it would directly notify the user of available updates, is on Firefox start-up or something, or a set amount of time after the last 'user interaction' with the updater.

So you are browsing, an update comes in, the monkey face changes. You continue browsing, some more updates are found but these are silently logged to a list, and 15-30 minutes after the first update was found, a little notification (like the add-on update one) appears to let you know updates were found. (Unless you had already updated by then)

The notification would not appear again to your either restarted Firefox, or you installed the updates then more became available.

 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

Tim Smart wrote:
Maybe, just maybe, we could to the whole 'on execution' thing
I'm liking this a lot. I like the idea of changing the monkey face when new updates are available. It's very unobtrusive which makes it a great idea. "Show updates available" would be in the right-click menu, right?

I agree that at the start up of Firefox we should automatically prompt them to install updates(this also should be possible to turn off somewhere) and I don't think we should prompt for installing updates(an unobtrusive notification is ok) anywhere else or we risk interrupting the browsing experience which will piss people off.

There also should be an option to force check all installed(enabled) scripts for updates. For this all to work nicely I think we need a dedicated UI dialog just for updates.


Another problem we are going to run into is: what do we with scripts that are already installed when users update to the version of GM with an update checker? I mean who the fuck knows where those came from? Any ideas?

 
Tim Smart Scriptwright
FirefoxMacintosh

sizzlemctwizzle wrote:
Any ideas?

In short: we can't. The information needed isn't there >.< I mean, the closest you can get is searching the name on USO, but that is far from reliable...

 
lazyttrick Scriptwright
FirefoxWindows

sizzlemctwizzlewrote:
His updater even checks for updates of disabled scripts which is just stupid imo.
That's not avoidable from an userscript perspective. Unless they come up with GM_scriptDisabledListener.
So you mean an option to avoid the GM user script install confirmation dialog when updating all scripts would be set to false by default?
With all the new ideas, I'm adapting to this:
- GM requires confirmation before installing anything;
- An "update all" button similar to add-on's would break this policy;
- The solution could be some kind of per script option.
what do we with scripts that are already installed when users update to the version of GM with an update checker?
If the original URL is not available, alert the user about the new feature and recommend reinstalling, or just leave it alone and things will fall into place eventually. I think it's better to notify the user, shortly.
 
sizzlemctwizzle Scriptwright
FirefoxMacintosh

lazyttrick wrote:
That's not avoidable from an userscript perspective. Unless they come up with GM_scriptDisabledListener.
Well actually it's in the config.xml(which you read to import scripts) and each script has an enabled attribute, but I'm fully aware of the limitations(like how now file:// includes are disabled by default) of trying to make an update checker as a script. I was just pointing this out so that hopefully the future GM updater doesn't do that.
lazyttrick wrote:
If the original URL is not available, alert the user about the new feature and recommend reinstalling, or just leave it alone and things will fall into place eventually. I think it's better to notify the user, shortly.
We should definitely notify them of this the first time they use the new version of Greasemonkey if they already have scripts installed.
lazyttrick wrote:
With all the new ideas, I'm adapting to this:
I think what Tim proposed in his post will work best for this:
Tim Smart wrote:
Ah! I probably didn't speak my mind well enough. It would be similar to Firefox's add-on updates, where it lists all the possible updates, with a tick box on each one, letting the user decide whether they want it installed or not. Sound good?
The tick box would effectively be the install confirmation as long as all the tick boxes where disabled by default.

 
Rycochet Scriptwright
FirefoxWindows

My 2p worth...

A @source meta for scripts to say where they come from - this would point at the uso install link for uso scripts, or whatever the source install link is for other scripts.

A @website meta linking to the About page (or similar) - so any update can let you click a link to see about it. The @update link from the *new* version is shown when an update is available (so it can point straight to the changelog etc if the scriptwright wants.

For scripts that point at the uso install then parse the uso Version in the About tab instead (save false install stats) - unless the false install stats could be overridden server-side if the GET is only for a smaller section of the source including the @meta block.

GM to store a hash of the installed version on install - and only automate the install if the hash hasn't changed (if it changes then no need to check every time). Any scripts that don't match the hash get shown to the user with a double-check tickbox and BIG WARNING that it's different etc.

The update to run at the same time as Firefox's own updates - and integrated with the Addons panel etc. Oh - and definitely done properly, I like the Chromifox theme :-P