Infocatcher / Private_Tab

Adds private tabs, restartless extension for Firefox (20.0+) and SeaMonkey (2.17+)
https://addons.mozilla.org/addon/private-tab/
Other
86 stars 20 forks source link

Add support for Library View #120

Open PantherX opened 10 years ago

PantherX commented 10 years ago

If I open my RSS feed from the toolbar in the browser window, I get the option to open it in a private tab as shown below: normal

However, when I attempt to do the same from the Library view, I can't open the same RSS feed in a private tab as shown below: library mode

Can you please add this feature if possible?

Infocatcher commented 10 years ago

I'll try to implement this. But it's difficult to implement "Open All in Private Tabs" because I'm reuse some built-in code and need to know target browser window (currently I just call built-in function to open bookmarks and toggle private mode for all new tabs). And for now only "Open in a New Tab" uses only non-private windows, this looks like a bug and may be changed later. And Library also works fine without opened browser windows.

Also you can open chrome://browser/content/places/places.xul in tab or use bookmarks sidebar.

PantherX commented 10 years ago

Thanks for the explanation. Given a choice between "Open All in Private Tabs" and "Open in Private Tab" for the library module, I would be content with the single tab option. I did accidentally discover that Library can be standalone.

Thanks for your suggestion of the bookmarks sidebar. However, since I have a dual monitor set-up, it makes it much easier for my workflow to have the library open on a separate monitor without cluttering up the main interface. However, I was completely unaware of the the tab feature and it does help when I am traveling. Thanks so much for sharing that vital tip :)

Infocatcher commented 10 years ago

Yet another trick. You can use following code to open Library in "popup" window (this is separate browser window with only one tab, but all toolbars are hidden):

window.openDialog(
    getBrowserURL(),
    "_blank",
    "chrome,dialog=0,resizable=1",
    "chrome://browser/content/places/places.xul"
);

Or the same with simple fix for window title:

var win = window.openDialog(
    getBrowserURL(),
    "_blank",
    "chrome,dialog=0,resizable=1",
    "chrome://browser/content/places/places.xul"
);
win.addEventListener("load", function removeURLFromTitle(e) {
    win.removeEventListener("load", removeURLFromTitle, false);
    var doc = win.document;
    function updateTitle() {
        var oldTitle = doc.title;
        var newTitle = oldTitle.replace(/^\w+:\S* - /, "");
        if(newTitle != oldTitle)
            doc.title = newTitle;
    }
    updateTitle();
    var stopTime = Date.now() + 5e3;
    var updateTitleTimer = win.setInterval(function() {
        if(Date.now() > stopTime)
            win.clearInterval(updateTitleTimer);
        updateTitle();
    }, 200);
}, false);

And Firefox (and Private Tab with extensions.privateTab.dontUseTabsInPopupWindows = true) doesn't use tabs in such windows. To run the code you can use extension like Custom Buttons.