Private_Tab icon indicating copy to clipboard operation
Private_Tab copied to clipboard

Middle Click Icon to open new tab as child of current tab

Open PantherX opened this issue 12 years ago • 3 comments

I am currently using Tree Style Tab (https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/) and one of its feature is that if you middle click the "New Tab" button, the new tab will open up as a child of the current tab. When I try the same with the "Private Tab", it doesn't open up as a child tab. Instead it opens up at the bottom of the tab list unattached to any tree.

I was hoping that you can add this as an enhancement to your add-on which would be great. Thanks.

PantherX avatar Nov 10 '13 20:11 PantherX

Already works, but only for "New Private Tab" button after last tab (and only until tab bar isn't overflows). Also Tree Style Tab provides options for this behavior (Options – New Tabs – For middle click on the "New Tab" button, open new blank tab as). So, I think, this isn't right to handle third-party options from Private Tab. I may add ability to open in sibling tab after middle-click (may be useful even without any other extensions), but Tree Style Tab should be able to override this behavior... Anyway, please report this request to Tree Style Tab developer too: https://github.com/piroor/treestyletab/issues

I updated API: 5635dddada722031609483c83bbca1a8155f27a4, so now can be used things like

window.addEventListener("PrivateTab:OpenNewTab", function(e) {
    var tab = e.target;
    if(e.detail)
        TreeStyleTabService.readyToOpenChildTab(gBrowser.selectedTab);
}, true);

or

window.addEventListener("PrivateTab:OpenNewTab", function(e) {
    var tab = e.target;
    if(e.detail)
        gBrowser.moveTabTo(tab, gBrowser.tabContainer.selectedIndex + 1);
}, true);

(but this is also for left-click with any modifier and also for clicks on "New Private Tab" menu item)

Infocatcher avatar Nov 12 '13 06:11 Infocatcher

Updated: c5ac763461be28aafc5c1807966aba90472e90e5, "Open new private tab after current, if item/button is middle-clicked". Now other extension can use something like

window.addEventListener("PrivateTab:OpenNewTab", function(e) {
    var tab = e.target;
    if(e.detail) {
        e.preventDefault();
        TreeStyleTabService.readyToOpenChildTab(gBrowser.selectedTab);
    }
}, true);

Infocatcher avatar Nov 12 '13 06:11 Infocatcher

Thanks very much the feature implementation. I have added the request to Tree Style Tabs (https://github.com/piroor/treestyletab/issues/603).

PantherX avatar Nov 13 '13 20:11 PantherX