mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 826146 - Add a pref-controlled install confirmation override for automation. r=sicking
This commit is contained in:
parent
c3088a801a
commit
96f2bec98f
@ -1382,8 +1382,14 @@ this.DOMApplicationRegistry = {
|
||||
sendError("INVALID_SECURITY_LEVEL");
|
||||
} else {
|
||||
app.etag = xhr.getResponseHeader("Etag");
|
||||
Services.obs.notifyObservers(aMm, "webapps-ask-install",
|
||||
JSON.stringify(aData));
|
||||
// We allow bypassing the install confirmation process to facilitate
|
||||
// automation.
|
||||
if (Services.prefs.getBoolPref("dom.mozApps.auto_confirm_install")) {
|
||||
this.confirmInstall(aData);
|
||||
} else {
|
||||
Services.obs.notifyObservers(aMm, "webapps-ask-install",
|
||||
JSON.stringify(aData));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sendError("MANIFEST_URL_ERROR");
|
||||
|
@ -719,6 +719,14 @@ SpecialPowersAPI.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Disables the app install prompt for the duration of this test. There is
|
||||
// no need to re-enable the prompt at the end of the test.
|
||||
//
|
||||
// The provided callback is invoked once the prompt is disabled.
|
||||
autoConfirmAppInstall: function(cb) {
|
||||
this.pushPrefEnv({set: [['dom.mozApps.auto_confirm_install', true]]}, cb);
|
||||
},
|
||||
|
||||
addObserver: function(obs, notification, weak) {
|
||||
var obsvc = Cc['@mozilla.org/observer-service;1']
|
||||
.getService(Ci.nsIObserverService);
|
||||
|
Loading…
Reference in New Issue
Block a user