MDN wants to learn about developers like you:


The NativeWindow object is only available to privileged code running on Firefox for Android, and is intended for use by Firefox for Android add-ons.


Returns a reference to the NativeWindow.doorhanger object, which can be used to display doorhanger notifications (also known as popup notifications) on Firefox for Android.

Doorhanger notifications provide a way to present decisions to users which is less intrusive than a modal dialog. You can display a doorhanger using On Firefox for Android a doorhanger displays a title and an array of buttons for the user choices: selecting a button calls the corresponding callback function. Doorhangers are attached to a specific tab, and you can control the doorhanger's persistence.

You can close a doorhanger explicitly using NativeWindow.doorhanger.hide().


In the example below, an add-on adds a new menu item labeled "Offer cake" which constructs and shows a new doorhanger when selected.

The doorhanger contains two buttons, which just show different toast messages when selected:

var menuID;

function offerCake(window) {
  let buttons = [
      label: "Yes, please!",
      callback: function () {"yum", "short");
      label: "Not today",
      callback: function () {"still hungry", "short");

  let message = "How about some cake?";
  let options = {
    persistence: 1
  };, "cake-request", buttons,

function loadIntoWindow(window) {
  if (!window)
  menuID ="Offer cake", null, function(){  

function unloadFromWindow(window) {
  if (!window)


Show a doorhanger notification.
Hide a doorhanger notification.

Document Tags and Contributors

 Last updated by: wbamberg,