Bug 895638 - Reinstall permissions when the runtime is upgraded. r=wesj

This commit is contained in:
Marco Castelluccio 2014-03-24 09:10:56 -04:00
parent 40e12f4211
commit 8c1fa0accb

View File

@ -49,15 +49,15 @@ let WebappRT = {
if (aStatus == "new") {
this.getDefaultPrefs().forEach(this.addPref);
// prevent offering to use helper apps for things that this app handles
// i.e. don't show the "Open in market?" popup when we're showing the market app
let uri = Services.io.newURI(aUrl, null, null);
// update the blocklist url to use a different app id
let blocklist = Services.prefs.getCharPref("extensions.blocklist.url");
blocklist = blocklist.replace(/%APP_ID%/g, "webapprt-mobile@mozilla.org");
Services.prefs.setCharPref("extensions.blocklist.url", blocklist);
}
// On firstrun, set permissions to their default values.
// When the webapp runtime is updated, update the permissions.
if (aStatus == "new" || aStatus == "upgrade") {
this.getManifestFor(aUrl, function (aManifest, aApp) {
if (aManifest) {
PermissionsInstaller.installPermissions(aApp, true);