Bug 1306536 - Don't set displayURI when it's set to false; r=mconley
MozReview-Commit-ID: DI52QqsS3BE
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -128,18 +128,19 @@ this.PermissionPromptPrototype = {
return undefined;
},
/**
* These are the options that will be passed to the
* PopupNotification when it is shown. See the documentation
* for PopupNotification for more details.
*
- * Note that prompt() will automatically set displayURI to
- * be the URI of the requesting pricipal.
+ * Note that prompt() will automatically set displayURI to
+ * be the URI of the requesting pricipal, unless the displayURI is exactly
+ * set to false.
*/
get popupOptions() {
return {};
},
/**
* PopupNotification requires a unique ID to open the notification.
* You must return a unique ID string here, for which PopupNotification
@@ -324,17 +325,20 @@ this.PermissionPromptPrototype = {
popupNotificationActions.push(action);
}
let mainAction = popupNotificationActions.length ?
popupNotificationActions[0] : null;
let secondaryActions = popupNotificationActions.splice(1);
let options = this.popupOptions;
- options.displayURI = this.principal.URI;
+
+ if (!options.hasOwnProperty('displayURI') || options.displayURI) {
+ options.displayURI = this.principal.URI;
+ }
this.onBeforeShow();
chromeWin.PopupNotifications.show(this.browser,
this.notificationID,
this.message,
this.anchorID,
mainAction,
secondaryActions,