Search code examples
androidfirefoxfirefox-addon-sdk

How to make dynamic menu in firefox addon for android?


I wan to make item in main menu that will contains more items depends on some properties. I add var menuID = window.NativeWindow.menu.add({callback:handleState, otherParams}) and make some sub items. But when i click to parent item handleState isn't call. So i can't update visibility of my items. How to subscribe on onClick event of main menu item?


Solution

  • I can't find how to fire callback so i use observer

    nativeObserver: {
            observe: function (aSubject, aTopic, aData) {
                if (aTopic != "after-viewport-change") return;
                MenuHandler.handleNativeMenuState();
            }
        },