mozilla
Your Search Results

    NativeWindow

    NativeWindow allows add-on developers to manipulate the native Android UI. The API gives you access to:

    The basic API is here:

    /*
    label: menu label
    icon: file:// or data: URI for an icon
    callback: JS function called when menu is tapped
    returns a menu ID that can be used to remove the menu
    */
    menuID = NativeWindow.menu.add(label, icon, callback);
    NativeWindow.menu.remove(menuID);
    
    /*
    message: displayed text
    value: string based tag
    buttons: array of JS objects used to create buttons in the notification
    tabID: tab associated with this notification
    options: JS object that has 'persistence' and 'timeout' options
    */
    NativeWindow.doorhanger.show(message, value, buttons, tabID, options);
    NativeWindow.doorhanger.hide(value, tabID);
    
    /*
    label: menu label
    selector: JS object that has a 'matches(element)' function. Used to show the menu.
    callback: JS function called when menu is tapped
    returns a menu ID that can be used to remove the menu
    */
    menuID = NativeWindow.contextmenu.add(label, selector, callback);
    NativeWindow.contextmenu.add(menuID);
    
    /*
    message: displayed text
    duration: "short" or "long"; Used for alert timeout
    */
    NativeWindow.toast.show(message, duration);
    

    Document Tags and Contributors

    Contributors to this page: wbamberg
    Last updated by: wbamberg,