mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 814157 - Need additional security checks for the "desktop-notification" permission. r=fabrice
This commit is contained in:
parent
a8f9e85501
commit
e705855918
@ -741,10 +741,16 @@ var AlertsHelper = {
|
||||
uid, name, null);
|
||||
},
|
||||
|
||||
receiveMessage: function alert_receiveMessage(message) {
|
||||
let data = message.data;
|
||||
receiveMessage: function alert_receiveMessage(aMessage) {
|
||||
if (!aMessage.target.assertPermission("desktop-notification")) {
|
||||
Cu.reportError("Desktop-notification message " + aMessage.name +
|
||||
" from a content process with no desktop-notification privileges.");
|
||||
return null;
|
||||
}
|
||||
|
||||
let data = aMessage.data;
|
||||
let listener = {
|
||||
mm: message.target,
|
||||
mm: aMessage.target,
|
||||
title: data.title,
|
||||
text: data.text,
|
||||
manifestURL: data.manifestURL,
|
||||
|
@ -1810,6 +1810,9 @@ ContentParent::RecvShowAlertNotification(const nsString& aImageUrl, const nsStri
|
||||
const nsString& aText, const bool& aTextClickable,
|
||||
const nsString& aCookie, const nsString& aName)
|
||||
{
|
||||
if (!AssertAppProcessPermission(this, "desktop-notification")) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_ALERTSERVICE_CONTRACTID));
|
||||
if (sysAlerts) {
|
||||
sysAlerts->ShowAlertNotification(aImageUrl, aTitle, aText, aTextClickable,
|
||||
|
Loading…
Reference in New Issue
Block a user