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-apply updates #1442

Closed
arantius opened this Issue Oct 6, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@arantius
Collaborator

arantius commented Oct 6, 2011

Ref: http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/AddonManager.jsm#1407

If we write code properly, Firefox will auto-install updates for us. There's also a pref extensions.update.autoUpdateDefault I believe, that controls this.

Details need to be determined, but we should probably default to acting like Firefox does for extensions.

@sizzlemctwizzle

This comment has been minimized.

Show comment
Hide comment
@sizzlemctwizzle

sizzlemctwizzle Oct 11, 2011

Contributor

You can also set this this on a per-script basis using the applyBackgroundUpdates prop on ScriptAddon. These are the possible values.

Contributor

sizzlemctwizzle commented Oct 11, 2011

You can also set this this on a per-script basis using the applyBackgroundUpdates prop on ScriptAddon. These are the possible values.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Oct 21, 2011

Collaborator

So the current situation is that this setting doesn't really do much of anything for us. Our primary update checking codepath is in the greasemonkey component's runScripts(), which fires off update checking at the point in time that scripts actually run. (Another way to make sure we don't unnecessarily cause server load -- only check for updates on scripts that are actually in use.)

The way to get an update actually applied is (it seems) to call onUpdateAvailable() on an UpdateListener, passing it the addon and the addoninstall. It seems like ( ref ) any old object with an onUpdateAvailable property will do. But it will have to deal with 3.x as well...

Collaborator

arantius commented Oct 21, 2011

So the current situation is that this setting doesn't really do much of anything for us. Our primary update checking codepath is in the greasemonkey component's runScripts(), which fires off update checking at the point in time that scripts actually run. (Another way to make sure we don't unnecessarily cause server load -- only check for updates on scripts that are actually in use.)

The way to get an update actually applied is (it seems) to call onUpdateAvailable() on an UpdateListener, passing it the addon and the addoninstall. It seems like ( ref ) any old object with an onUpdateAvailable property will do. But it will have to deal with 3.x as well...

arantius added a commit to arantius/greasemonkey that referenced this issue Oct 21, 2011

Apply remote updates immediately upon discovery.
Firefox 4 only, yet.  This includes making the code work for both the automatically (at script run time) and manually (via add-ons manager UI) discovered code paths.

Refs #1442

@arantius arantius closed this in 4acfd64 Oct 21, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment