зеркало из https://github.com/mozilla/gecko-dev.git
Bug 980682 - Ensure mozAlarms doesn't throw on chrome documents and fix alarms set on non-index.html pages. r=gene
This commit is contained in:
Родитель
ac1bf381e1
Коммит
90b68f9d4e
|
@ -168,6 +168,12 @@ AlarmsManager.prototype = {
|
|||
return null;
|
||||
}
|
||||
|
||||
// SystemPrincipal documents do not have any origin.
|
||||
// Reject them for now.
|
||||
if (!principal.URI) {
|
||||
return null;
|
||||
}
|
||||
|
||||
this._cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"]
|
||||
.getService(Ci.nsISyncMessageSender);
|
||||
|
||||
|
@ -180,7 +186,7 @@ AlarmsManager.prototype = {
|
|||
// Get the manifest URL if this is an installed app
|
||||
let appsService = Cc["@mozilla.org/AppsService;1"]
|
||||
.getService(Ci.nsIAppsService);
|
||||
this._pageURL = aWindow.location.href;
|
||||
this._pageURL = principal.URI.spec;
|
||||
this._manifestURL = appsService.getManifestURLByLocalId(principal.appId);
|
||||
this._window = aWindow;
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче