Incompatibility with Tree Style Tab and other sidebar addons

Any feedback, suggestion, bug reports, problems....
Post Reply
piro_or
Posts: 1
Joined: Thu Sep 12, 2019 11:34 am

Incompatibility with Tree Style Tab and other sidebar addons

Post by piro_or » Thu Sep 12, 2019 11:45 am

Some addons using browser.menus.overrideContext() imports extra context menu commands provided by other addons. For example, a sidebar panel of Tree Style Tab https://addons.mozilla.org/firefox/addo ... style-tab/ works like a vertical tab bar and right-click on the panel shows a simulated tab context menu. Flagfox's tab context command is also visible under the menu.

However, commands of Flagfox actually don't work. After investigation I've realized that the parameter "frameUrl" - a part of "info" object for callbacks of browser.menus.onClicked - becomes to an internal URL of the sidebar panel itself, like "moz-extension://xxxx-xxxx-xxxx-xxxx/..." on such cases. Thus,

Code: Select all

function getTopPriorityUrlFromMenuEvent(info) {
    for (const prop of ["srcUrl","linkUrl","frameUrl","pageUrl"])
        if (isNonEmptyString(info[prop]))
            return info[prop];
    return null;
}
this function returns such an internal URL and

Code: Select all

browser.menus.onClicked.addListener(function(info, tab) {
    newLocationForMenuEvent(info, tab).then(location => {
        actions.doAction(getActionIDfromMenuItemID(info.menuItemId), location, getOpenInModeForMenuEvent(info));
        debugLog_events("Flagfox menu item click processed for target:", info, tab, location);
    });
});
this callback fails to process the command due to the "location" filled with an internal URL.

Could you make Flagfox compatible with such type addons?
This problem was originally reported at Tree Style Tab's issue tracker: https://github.com/piroor/treestyletab/issues/2363

Advertisements

 

Post Reply