Bug 1519095 - Allow changing the text of an existing notification. r=jaws
☠☠ backed out by cefe669c7351 ☠ ☠
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Mon, 21 Jan 2019 19:56:38 +0000
changeset 515125 00074091644d1aab8e83060c14f63e3104089f68
parent 515124 55c218c9489b1dfd5a58f6b0abfc907c3d8bcc7d
child 515126 2d7c13dfec2dfc7f3300e767315db3518ab96676
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1519095
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519095 - Allow changing the text of an existing notification. r=jaws This fixes the notification bar that shows how many popup windows have been blocked. Differential Revision: https://phabricator.services.mozilla.com/D17152
toolkit/content/widgets/notificationbox.js
--- a/toolkit/content/widgets/notificationbox.js
+++ b/toolkit/content/widgets/notificationbox.js
@@ -333,16 +333,24 @@ MozElements.Notification = class Notific
     }
   }
 
   get control() {
     return this.closest(".notificationbox-stack")._notificationBox;
   }
 
   /**
+   * Changes the text of an existing notification. If the notification was
+   * created with a custom fragment, it will be overwritten with plain text.
+   */
+  set label(value) {
+    this.messageText.textContent = value;
+  }
+
+  /**
    * This method should only be called when the user has manually closed the
    * notification. If you want to programmatically close the notification, you
    * should call close() instead.
    */
   dismiss() {
     if (this.eventCallback) {
       this.eventCallback("dismissed");
     }