piroor / treestyletab

Tree Style Tab, Show tabs like a tree.
http://piro.sakura.ne.jp/xul/treestyletab/
Other
3.49k stars 278 forks source link

Migrate to WebExtensions for Firefox 57 and later #1224

Closed theres-waldo closed 5 years ago

theres-waldo commented 7 years ago

Mozilla recently announced that starting in Firefox 57, Firefox will no longer support addons that are not WebExtensions.

Is it possible to convert Tree Style Tab to be a WebExtension, so it can continue working in Firefox 57 and beyond?

nt1m commented 7 years ago

The second bug you linked to does seem like it would allow that, can you confirm ?

Not sure, the open API only works when initiated through "explicit user action" (click for example), and has to be immediate. Might not work for the use case you mentioned, as listening for a mouseover event isn't explicit, not to mention that sending an event from the content script to the extension process isn't immediate.

It's possible to have a toolbar button that opens and closes the sidebar when you click though.

Okamoi commented 7 years ago

@nt1m It would displace content though, wouldn't it ? TST's legacy hide/show feature is set so that the sidebar is semi-transparent and appears over content, instead of resizing the content area so both the panel and the content can fit in the window.

Well either way I'll be leaving it at that in order to leave room for other issues that are more of interest to Piroor. Thanks for your insight :)

gonhidi commented 7 years ago

If sidebar autohiding is done by editing userChrome.css it doesn't displace the content, so perhaps it is viable to have an API do so. Meanwhile, it would be nice to have a hotkey to toggle the extension's visibility (even if it displaces content), though perhaps it is not (yet) possible (in a similar fashion to how configuring where new blank tabs are opened currently only works when clicking on the extension's plus button and not when using the new tab hotkey—or menu item—, unlike the pre-WebExtensions version).

bitonic commented 7 years ago

this is great! my only complaint is that it does not show the colors corresponding to the container that the tab is in (the old extensions did that)

ibrahima commented 7 years ago

Btw, Firefox v57 just went into beta (Firefox Developer Edition just updated to it) so there might be an influx of users trying to switch to the WE version. Thanks for putting up a prebuilt nightly! The current version installs for me. I'm sad that there's no way to hide the tab bar yet... trying to figure out if I can live with this.

I really wish they had given more time for extension developers to update, seems kinda crappy to push us over the WebExtensions cliff without building the APIs needed to replicate the old functionality...

theres-waldo commented 7 years ago

I'm sad that there's no way to hide the tab bar yet... trying to figure out if I can live with this.

While I haven't tried it, I hear you can hide the tab bar using userChrome.css:

https://bugzilla.mozilla.org/show_bug.cgi?id=1332447#c42

BrianGilbert commented 7 years ago

you can definitely hide them via UserChrome.css, but you lose indicator that the tab is loading if you do this.. I was looking for an extension that would show progress on the address bar, and even tried porting Pace4Chrome, but no luck so far.

ibrahima commented 7 years ago

Nice! I actually still see the loading indicator in the TST sidebar. Btw, as per one of the comments on Bugzilla the CSS comes from tabcenter-redux, and this comment seems to have the latest iteration: https://github.com/eoger/tabcenter-redux/issues/15#issuecomment-321710657

For easy reference:

#TabsToolbar {
  min-height: 31.5px (Windows) / 27px (macOs) / no rule on linux
}

#TabsToolbar > * {
   visibility: collapse;
}
asamuzaK commented 7 years ago

If your on Windows,

#TabsToolbar {
  visibility: collapse;
}

and open Customize menu, check Titlebar will do.

toolbar

joshuacant commented 7 years ago

I'm so happy to see how well this is coming along. One thing I'm missing is being able to change tabs by scrolling over the tree. In current FF, I think this functionality is provided for me by Tab Mix Plus. Going forward, I think it would have to be implemented in this addon, though. Is that right?

ibrahima commented 7 years ago

Probably... unfortunately, I don't know if TMP is working on a WebExtensions port, seemed inconclusive when I checked a few days ago. Must suck to build such a huge extension and then have to watch it die, as I'm guessing most of those features don't have API equivalents in WebExtensions. Luckily for me I didn't use most of TMP's functionality so I'm fine with TST alone, but this is a sad time for Firefox power users.

janisozaur commented 7 years ago

With Fx 57 now in beta, I was trying to install the listed addon from nightly, but it appears to be unsigned. https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox only lists "Developer", "Nightly" and "45 ESR" as the ones who can opt-out of addon signing (not counting unbranded versions). Is there a signed version or another way how can I use it?

diox commented 7 years ago

@janisozaur the latest version (2.0) on AMO should be signed: https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/

janisozaur commented 7 years ago

Great, that works, thanks!

mimoo commented 7 years ago

It works this is awesome!

RobT2012 commented 7 years ago

Yeah it works, but FF will refuse to spawn multiple process because TST needs to be re-implemented as a web extension. That's a biggie, since one of the main points of the new FF is to spawn multiple processes just like Chrome does. I think you still get muti-core support, but note that FF defaults to only 4 cores, so if you have AMD Ryzen or TR you need to about:config it to use all the cores/threads.

RobT2012 commented 7 years ago

Well when I remove all the add-on's, I still don't see multiple FF processes, so whatever is going wrong has nothing to do with TST.

ralesk commented 7 years ago

@RobT2012 TST 2.0 which is compatible with FF57+ is a WebExtension.

mimoo commented 7 years ago

broke again :(

RobT2012 commented 7 years ago

@ralesk

Yes, I figured that out after posting. I removed all add-ons, so whatever is preventing multiple processes from spawning has nothing to do with TST. I'm using nightly build 58 so it could be anything at this point, or perhaps the terminology used to describe a FF "process" is not a normal Linux process as I expected. So far, everything is working, I just don't see more than one FF process running and I don't have any idea even if more than one core is being used.

FF is reporting this:

about:support Multiprocess Windows 2/2 (Enabled by default) Web Content Processes 8/8

So who knows. I cannot decipher what those metrics are for as of yet, looking for some documentation describing what those values mean. Anyway, the issues I'm having have nothing do to do with TST so I'll take it up elsewhere. TST is working just fine for me!

nnethercote commented 7 years ago

@RobT2012: the about:support suggests that multi-process is working for you. But note that FF content processes are not called "firefox", they are (non-obviously) called "plugin-container".

simu commented 7 years ago

@RobT2012 @nnethercote For me the content processes are actually called "Web Content" on Linux with Firefox 57b3.

TST 2.0 works fine for me, good work @piroor.

I'm currently using the following userChrome.css:

#TabsToolbar {
  visibility:collapse;
}
#sidebar-header {
  display:none;
}

so TST on the left looks almost like it used to. Additionally, I've found that setting

.tab {
  padding: 1px;
}

In TST's "Extra style rules for sidebar contents" gives the tabs a look that I prefer over the default amount of whitespace in each tab. Note that due to how the sidebar layout is computed you may have to restart Firefox after adding the rule, one symptom is that collapsed tab trees may look super sketchy with the padding set to 1px before restarting the browser.

RobT2012 commented 7 years ago

@simu

I was not seeing "web content" processes either. Today I updated to the latest nightly and now I see 4 "web content" processes, so everything finally looks right.

I hanged on to old FF for as long as I could only because of TST but eventually I gave up and switched to Chrome as my default browser. I still kept using FF for certain things because of TST but not very often. I'm now happy enough to make FF my default browser again. I hope Mozilla can recover, they lost a lot of users.

I really like the idea of tab groups and so on, but it's just not enough, and I cannot understand why all the major browser devs refuse to consider implementing native tree tabs, it's a basic need for anyone who does a lot of browsing.

joshuacant commented 7 years ago

Hey @piroor is mouse wheel scrolling to change tabs on your roadmap at all? This is such an important feature for me I'd probably attempt to learn programming webextensions if it's not something you'd add in. I know it's a trivial/unnecessary feature for most people, but it's one of those workflow must-haves for me. Thanks again for all your work in rebuilding, I can't overstate how impressed and happy I am.

SXZ1 commented 7 years ago

@xamphear Mouse wheel scrolling is currently used to scroll the contents of the sidebar when the sidebar can't fit all opened tabs. I guess possible solution is to change tabs when mouse is hovered over the tabs and scroll the contents of the sidebar when the mouse is hovered over the scroll bar (the one in the sidebar).

joshuacant commented 7 years ago

@SXZ1 The way it works in legacy Firefox w/ TST and TMP is that once you have enough tabs to need scrolling, a thin scroll bar appears which you can use to scroll up and down.

piroor commented 7 years ago

@xamphear It is discussed at #1399.

maximilianoe commented 7 years ago

Everytime I open a new private window the sidebar is hidden. Not sure if this is a Webextension issue, is there a way to show the TreeStyle sidebar in private windows by default so I don't need to press Ctrl + H and then manually choose TreeStyle?

mimoo commented 7 years ago

Firefox is really slow currently, I only have Tree Style Tabs enabled, it looks like it doesn't like it.

SkySkimmer commented 7 years ago

Well I've migrated. Most annoying is the crazy scrolling at new tab because of https://bugzilla.mozilla.org/show_bug.cgi?id=1387372

1384 is also a problem.

In general opening and closing tabs is slower when the window has a lot of tabs. When closing a tab at the end of a tree, the focus moves to the next tab then jumps back to the previous tab.

I don't really care about this but I was surprised by it: when moving to next tab with Ctrl+Tab, it used to skip over collapsed trees but now it goes inside them. I guess if I didn't userchrome the native tab bar away it would look sensible there.

Good luck with future bugs.

JakubJagoda commented 7 years ago

Hi, the extension works well, but I have one problem - after closing Firefox, opening it again and choosing History -> Restore Previous Session the tree structure seems to be forgotten and tabs are flattened and mixed. Is it only me? Firefox 57.0b9, Win 10, TST in version 2.0.5 from 13.10.2017.

SXZ1 commented 7 years ago

@JakubJagoda this bug is discussed here: https://github.com/piroor/treestyletab/issues/1476

JakubJagoda commented 7 years ago

@SXZ1 3 hours before my post, that explains why I couldn't find it in the afternoon :) thanks

dionorgua commented 6 years ago

Any change to change font size of 'Tree Style Tab' title (where it's possible to switch bar to 'Bookmarks' / 'History' )?

Keith94 commented 6 years ago

@dionorgua Use userChrome.css and this code:

#sidebar-switcher-target {
  font-size: 75%;
}
SXZ1 commented 6 years ago

@piroor I've found STR for a couple of performance regressions but STR implies opening 190 blank tabs, that is possible to do in a couple of ways:

  1. Hold Ctrl-T for 5 seconds. However, you won't be able to relaunch the browser because TST can't restore 190 blank correctly (order of tabs gets messed up)
  2. I will upload saved session (sessionstore.jsonlz4) with 190 tabs to guthub, you'll have to copy it to the new profile and restore session. I'll use github.com tabs instead of blank new tabs so you'll be able to restore this session without problems. The most convenient way, IMO
  3. Open 190 github.com tabs yourself. Will take a loooong time.

Which way is more convenient for you? I guess I'll also record the video.

Confucij commented 6 years ago

As autohide feature was mentioned here before I thought this would be a good place to pin my code snippet for autohide. It is derivate from one found on GitHub

/*
 * Description: Auto-hide sidebar.
 * Contributor(s): img2tab
 */

#sidebar-box {
    position: fixed;
    top: 44px;
    bottom: 0;
    right: -254px;
    width: 255px;
    transition: 0.2s right;
}

#sidebar {
    min-width: 14em;
    width: 18em;
    max-width: 36em;
    height: 100%;
}
#sidebar-box:hover {
    right: 0 !important;

}
/* #sidebar-header is hidden by default, change "none" to "inherit" to restore it. */

#sidebar-header {
    display: none !important;
}
/* #sidebar-splitter styles the divider between the sidebar and the rest of the browser. */
#TabsToolbar {
    visibility: collapse;
}
mimoo commented 6 years ago

for others like me suffering from heavy lags on macOS. Removing the tab bar on top (via the css trick) seemed to have fixed the issue somehow

reverofevil commented 6 years ago

Can we at least have a version of TST for Firefox ESR in the official extension store? Firefox 57 is buggy beyond the limits, TST is barely working, and I cannot even install it with an old version of Firefox.

piroor commented 6 years ago

@polkovnikov-ph it seems still downloadable from: https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/versions/ (you'll need to download the file and drag-and-drop to Firefox's window manually.)

diox commented 6 years ago

Firefox 57 is super fast and reliable for a huge number of people, including with Tree Style Tab, so I would encourage you to persevere (maybe reset your profile?) and file bugs if you find any.

Nevertheless, if you want to keep using older versions of Firefox, you can install any old version of any extension on AMO using the versions list page. For Tree Style Tab see https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/versions/ (0.19.2017090601 should work with Firefox 52.0 to 56.*).

reverofevil commented 6 years ago

@piroor Thanks! That link is quite hard to find on add-on page, and it's a shame Mozilla doesn't let us download the latest compatible version with "add to firefox" button. As I'm using ESR, I was happy to download older version from https://github.com/piroor/treestyletab/releases/.

@diox Yes, I was very happy with Mozilla's efforts on improving Firefox performance lately, but they've made a release before all the major issues were solved. Having tight deadlines is not a good thing when you're making a major codebase rewrite.

For anyone who wants to persevere and still use Firefox 57: there is a workaround to hide annoying horizontal tabs.

grahamperrin commented 6 years ago

… Mozilla doesn't let us download the latest compatible version with "add to firefox" button …

To anyone with Firefox 58.x on a Tier-1 platform: is that still an issue?

piroor commented 5 years ago

I close this because this is too old and not match to the latest maintained version of TST.

mayhemer commented 5 years ago

It's RESOLVED FIXED :) Thank you!