mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827023 r=vingtetun
This commit is contained in:
parent
248890f607
commit
1da28e32f7
@ -82,13 +82,38 @@ WebappsRegistry.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Checks that we run as a foreground page, and fire an error on the
|
||||
// DOM Request if we aren't.
|
||||
_ensureForeground: function(aRequest) {
|
||||
let docShell = this._window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
if (docShell.isActive) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let runnable = {
|
||||
run: function run() {
|
||||
Services.DOMRequest.fireError(aRequest, "BACKGROUND_APP");
|
||||
}
|
||||
}
|
||||
Services.tm.currentThread.dispatch(runnable,
|
||||
Ci.nsIThread.DISPATCH_NORMAL);
|
||||
return false;
|
||||
},
|
||||
|
||||
// mozIDOMApplicationRegistry implementation
|
||||
|
||||
install: function(aURL, aParams) {
|
||||
let request = this.createRequest();
|
||||
|
||||
if (!this._ensureForeground(request)) {
|
||||
return request;
|
||||
}
|
||||
|
||||
this._validateScheme(aURL);
|
||||
|
||||
let installURL = this._window.location.href;
|
||||
let request = this.createRequest();
|
||||
let requestID = this.getRequestId(request);
|
||||
let receipts = (aParams && aParams.receipts &&
|
||||
Array.isArray(aParams.receipts)) ? aParams.receipts
|
||||
@ -159,10 +184,15 @@ WebappsRegistry.prototype = {
|
||||
// mozIDOMApplicationRegistry2 implementation
|
||||
|
||||
installPackage: function(aURL, aParams) {
|
||||
let request = this.createRequest();
|
||||
|
||||
if (!this._ensureForeground(request)) {
|
||||
return request;
|
||||
}
|
||||
|
||||
this._validateScheme(aURL);
|
||||
|
||||
let installURL = this._window.location.href;
|
||||
let request = this.createRequest();
|
||||
let requestID = this.getRequestId(request);
|
||||
let receipts = (aParams && aParams.receipts &&
|
||||
Array.isArray(aParams.receipts)) ? aParams.receipts
|
||||
|
Loading…
Reference in New Issue
Block a user