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.


NativeWindow.doorhanger.show() displays a doorhanger attached to a Firefox for Android tab. To hide the doorhanger explicitly, use NativeWindow.doorhanger.hide().


NativeWindow.doorhanger.hide(value, tabID);

The string which was supplied as the value argument to NativeWindow.doorhanger.show().

The ID of the tab to which the doorhanger is attached. This is the same value as the tabID argument to NativeWindow.doorhanger.show().


In the example below we show a doorhanger, but hide it if we receive a resize event from the 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    

  let tabID = window.BrowserApp.selectedTab.id;
  window.NativeWindow.doorhanger.show(message, "cake-request", buttons, tabID, options);  

  window.addEventListener("resize", function() {   
      window.NativeWindow.doorhanger.hide("cake-request", tabID);
  }, false);

See Also

Document Tags and Contributors

 Last updated by: wbamberg,