We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


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 NativeWindow.doorhanger.show(). 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 () {
        window.NativeWindow.toast.show("yum", "short");
      label: "Not today",
      callback: function () {
        window.NativeWindow.toast.show("still hungry", "short");

  let message = "How about some cake?";
  let options = {
    persistence: 1

  window.NativeWindow.doorhanger.show(message, "cake-request", buttons,

function loadIntoWindow(window) {
  if (!window)
  menuID = window.NativeWindow.menu.add("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,