hide

This article is in need of a technical review.

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.

Summary

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

Syntax

NativeWindow.doorhanger.hide(value, tabID);

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

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

Example

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

Contributors to this page: wbamberg, Joshua-S
Last updated by: wbamberg,