jingyu9575 / tabs-to-bookmark-groups

(Work in progress) Firefox extension to save the tabs to a bookmark group and switch between different groups.
https://addons.mozilla.org/firefox/addon/tabs-to-bookmark-groups/
Mozilla Public License 2.0
4 stars 1 forks source link

New Firefox extension idea: tab groups with closing instead of hiding #1

Closed jingyu9575 closed 5 years ago

jingyu9575 commented 5 years ago

Originaly written by @EstherMoellman

Hi @jingyu9575 ! Thank you for sharing with me your thoughts. I partially disagree (a bit) with you, but I perfectly understand your Dev' point of view, and I do recognize that most of your arguments are totally true.

However and changing subject, please allow me to take advantage of this contact, to challenge you to build a new add-on... a TAB-GROUPS add-on (TGAD). Most of the existent TGAD are very buggy, in part due to conflicts with new Firefox' functions (FPI First-party-isolation, Containers, Content-blocking, Fission etc), and in part also due to conflicts with other add-ons (specially ad-blockers, tracking-blockers, add-ons dealing with tabs, your add-on etc). But this happens with TGAD mainly because of the use an abuse of hiding/discarding-tabs. With time, most of the TGAD-data become corrupted. So, what's the idea to build a new TGAD? Simple! Not to use hiding nor discarding, but to deal with tabs as bookmarks.

Here is a good example of what I am talking about: https://addons.mozilla.org/en-US/firefox/addon/tab-group-switch/ Yeah, this add-on is very imperfect, and even, I can't use it because changes the order of the tabs (while loading them). But this add-on is a prove that a new kind of TGAD is perfectly doable. Sadly there are not TGAD like that. And even bookmark-manager or session-manager add-ons are very bad. I tested almost 20 of them. So, conclusion, there is a huge niche of users for this kind of TGAD, dealing with tabs as bookmarks, without hiding/discarding tabs. The advantages of this TGAD will be: a) Less conflicts with Firefox' functions, b) Less conflicts with other add-ons, c) Huge browser performance improvement.

If by chance you are interested in this challenge (and I offer you all my help), here below you have more details about this possible new TGAD:

1) Automatically "convert" visible tabs (in a window) into bookmarks, but saved inside a defined group. The order of the tabs should be preserved.

2) A toolbar button is required, allowing to jump from one group to another group, and also allowing to edit groups.

3) When a group is selected (from the toolbar button), the visible group must close (auto-saving all tabs and preserving tab order), switching and showing the chosen group, but loading (selecting) only the last active tab (it will be great an option allowing to choose which tab must be loaded: first, last, right, left or a pinned tab. Perhaps your add-on code may be useful here?).

PS1: When a group closes, tabs must be closed (not just be hidden, nor discarded). Also, when a tab is loaded, must be reloaded/refreshed.

PS2: It will be a fantastic plus, if tabs can be automatically opened in separated temporary containers.

4) The add-on must be lightweight (around 50kb ~ 500kb) and easy on CPU, RAM etc. No fancy stuff is needed! The less the better.

5) Not a must, but another plus will be: a) Dark Theme b) Back Up c) Open another tab when last active tab is closed d) Open source etc.

It will be fantastic if you are interested. And again, I offer you my help: We are a small "club" of university students (around 150 members in 8 different countries), using FF' Nightly with special CSS customizations, hacks etc. I offer you the help of these 150 students (including me) in order to test your add-ons, or to do other tests, researches etc... whatever we can help, I offer you.

But, if you don't like the challenge, or don't have time etc, don't worry at all, it is perfectly OK, I understand... we always will love you! (LOL) :)

Big hug

jingyu9575 commented 5 years ago

@EstherMoellman I'd like to first check what are the problems of existing extensions, to estimate the difficulty and see if it is practical.

Most of the existent TGAD are very buggy

I'm not aware of any incompatibilities of tab hiding with privacy features or other extensions. I only know one problem of STG with SACC and it has been fixed here. What are the issues you have seen?

With time, most of the TGAD-data become corrupted.

Firefox does have some data bugs, but other extensions aren't so prone to corruption. Why is this the case for TGAD?

EstherMoellman commented 5 years ago

Hi @jingyu9575 ... answering you:

In this field is possible to find around ±20 TGAD (tab-group-add-ons), mainly categorized as: a) Tab-groups b) Tab-Manager c) Session-Manager d) Bookmark-Manager

We (my small "club" having ±150 member) have tested most of these TGAD. Of course, they have differences, some of them are very basic add-ons, others are more advanced, others are bloated or full of unused fancy stuff, others are lightweight, others are big elephants etc. But at the end, all of them are trying to have the same core function: Dealing with tabs/bookmarks.

After 6 months of testing these ±20 TGAD (looking for the best one for our needs + our user-profile: around 500 tabs and 30 groups = useful for university students), our main conclusions are: 1) Most of these TGAD conflict with blocker-add-ons (ad-tracking-privacy-security-etc-blocker-add-ons). 2) Most of them also seem to conflict with some Firefox' functions such as: FPI First-Party-Isolation, Containers, Content-blocking etc. 3) Points "1)" and "2)" above, they cause browser performance issues (general slowdowns, sparks or white flashings, hangings, freezings, tons of RAM, tons of CPU, battery killers, high temperature etc). 4) After some days of use, the data-base of these TGAD sometimes are corrupted (impossible to backup tabs, tabs are missing etc). 5) Randomly, tabs behave in a spooky and weird way: Tabs saved at "X" group undesirably finish going at group "Z", or these tabs appear at different groups, or disappear completely etc... very annoying. 6) The total number of grouped tabs when the TGAD is enabled, sometimes doesn't match/equal the total number of tabs when the TGAD is disabled. 7) Etc.

Most of these issues I described above, they also can be confirmed by reading user-reviews at TGAD AMO' pages. And those TGAD with GitHub' repos, at "issues" area also is possible to see lot of reported bugs (similar to those I am reporting you above). No, I am not saying these TGAD are a general failure (most of the users reviews are positive). I am just saying that these TGAD have bugs, or at least we can say that other add-ons conflict with these TGAD, Firefox conflicts with these TGAD etc. Yeah, you're right, many add-ons have similar issues, but after 5 years using Firefox with lot of add-ons, and hard advanced customizations, believe me, these present TGAD are more buggy than regular add-ons.

From our experience and ignorance:

However and in the other hand, those TGAD using the bookmarking function instead hiding/discarding... they work much more better... they eliminate almost all conflicts, negative browser performance, spooky weird tab behavior etc. Unfortunately the problem is that these TGAD, in general are too basic, too primitive. And most of them are old, or seem to be abandoned etc.

As I already mentioned you, here is a TGAD that seems to me (and seems to our ±150 club members) as the winner today: https://addons.mozilla.org/en-US/firefox/addon/tab-group-switch Sadly, we can't use it... too primitive... too basic... and it mess up with user-tab-order. Our dreamed TGAD will be like this add-on, bookmarking tabs (instead of hiding/discarding), but also incorporating the five points I described you in my previous comment.

As I also said in my previous comment, there is a huge niche of potential users for this kind of TGAD, dealing with tabs as bookmarks, without hiding/discarding tabs. The advantages of this proposed TGAD will be:

I hope I've answered your questions. I also hope you will be interested in this project. I have contact with many Devs, but I offered this project only to you, because your add-ons work pretty nice, they are clear and clean (not bloated, no unused fancy stuff etc), they are functional, lightweight, open source etc etc etc etc etc etc... and you are a fantastic responsive Dev. So yeah, I am very excited about this possibility, and I really hope you will be interested and involved with this project.

We, as university student, really need a good TGAD, because it helps us a lot to deal with ton of tabs and tab-groups that we use for each subject where we are working or studying. So, our small club, our ±150 members, all of us remain at your disposal to help you in this possible project.

Again, thanks in advance!

jingyu9575 commented 5 years ago

Most of these TGAD conflict with blocker-add-ons

I've searched on GitHub of STG, Panorama View and Tab Session Manager, but haven't found much information about such conflicts. Could you list some links to bug reports here?

In my view, the bugs here can be roughly divided into the following categories:

  1. Extension stability issues. They can be fixed by careful and robust programming.
  2. Extension performance issues. They can be fixed by balancing features with costs, and choosing efficient method of implementation.
  3. Browser limitation. They are difficult or just impossible to solve.

I'd like to evaluate how many issues belong to category 3. If there are many issues that cannot be workarounded, the extension will be unreliable no matter what I do.

EstherMoellman commented 5 years ago

Hi @jingyu9575 ! As I said, most of these TGAD are not a failure, they work fine, and are reviewed with positive comments. But most of them have some bugs. And I reported you these bugs, but you can confirm them at AMO or GitHub' pages.

For instance, let's take a great add-on, SimpleTabGroup, one of the best. If you go to AMO' page (https://addons.mozilla.org/en-US/firefox/addon/simple-tab-groups/reviews/) you will see users posting issues, conflicts, bugs etc. The same goes to GitHub' page, "issues" area, and specially the "closed issues" area (many times issues are closed by the Dev, arguing that is an unsolvable issue, or a conflict with other add-on etc, not always closed issues are solved issues).

Perhaps you already did that, and didn't find the kind of bug you were interested to find. I understand you. But please, do you allow me an ignorant opinion? I'm not really sure this is a problem of browser limitations. Therefore, I'm not really sure this is a matter of bugs. Yeah, I may be wrong, but I just want to share my thoughts.

I never said that a new kind of TGAD is needed because all competitors are bad, buggy etc. My argument always was that a new kind of TGAD (bookmarking tabs instead of hiding/discarding tabs): a) Will have less conflicts (with other add-ons, with browser functions etc) b) Will improve browser performance

And I believe that this is not a matter of "browser limitation" => "add-on bugs", first because we already have more than 30 add-ons working as TGAD (if it was a browser limitation, then these 30 add-ons would be a fiasco, and they are not). Second, because I already presented you a feasible model (https://addons.mozilla.org/en-US/firefox/addon/tab-group-switch) that works well and without bugs. Again, I perfectly understand your logic, and your need to understand bugs, browser limitations etc. But I just invite you to take a shortcut: If around 30 TGAD already exists, and if we already have a feasible model-add-on, then in my ignorant opinion, your logic may be focused at: a) This model-add-on with your improvements and tweaks will have less conflicts than other TGAD? b) It will improve browser performance compared to other TGAD? c) Bookmarking tabs (instead hiding/discarding) + the 5 points on my first comment... this will make a new TGAD better than other competitors? If your answer is "no", then you must quit from this project. But if your answer is "yes", voilà, here we go, there is the reason for this new add-on, this new kind of TGAD.

Again, I believe that today this add-on (https://addons.mozilla.org/en-US/firefox/addon/tab-group-switch) is the best option. It just need to keep the user-tab-order, and also needs to include the 5 points I mentioned you in my first comment.

Have a nice weekend!

jingyu9575 commented 5 years ago

a) This model-add-on with your improvements and tweaks will have less conflicts than other TGAD? b) It will improve browser performance compared to other TGAD? c) Bookmarking tabs (instead hiding/discarding) + the 5 points on my first comment... this will make a new TGAD better than other competitors?

My answers are "I don't know", so I want to see specific cases of conflicts/performance problems and try to analyze whether closing instead of hiding can help.

Let me show an example, by debugging the conflict of STG with SmartAdBlock that you found:


The symptom is that the STG popup is slow when SAB is present. In the following screenshot, only 4 tabs are shown and 0 tabs are hidden. There are only 15 groups, most empty, but the popup already has a 2-second delay on my i7 laptop.

The bottom part of the screenshot is Firefox's performance analyzer. It shows that the checkall code is the reason of the slowness. The 7231d649... on the right is the extension's internal code that turns out to belong to SmartAdBlock.

screenshot

So I found the code of SmartAdBlock in the browser, and place a "breakpoint" in checkall. "Breakpoint" is a developer tool that pause the program when a certain code is trying to execute, so I can take the time to see what is going on here. Then I refreshed the popup and SAB paused on the breakpoint as the screenshot below.

First, see the bottom right part. This shows the reason that SAB wants to run this code. It is a webRequest event that typically runs when the browser is about to load a web page, image or script. Adblockers monitor this event and reject loading of ad contents.

In this case, the documentUrl is an moz-extension page that is obviously the STG popup. The type is image, so it is trying to monitor the loading of group icons icon.

sccreenshot

Inside this code, there is a loop that checks lots of rules against the request. The length of the rule list is 8942, shown at the top right box.

Imagine you are going through an airport, but the security checks all the item inside your bags against a checklist; and the checklist has 8942 items. It'll be sure to slow down a lot.

But why SAB is checking requests from another extension STG? Shouldn't Firefox prevent interactions between extensions to reduce conflicts? I highly suspect this is a Firefox bug, and other people also agree. Firefox's bug tracker is currently down, but I think Bug 1490932 describe this problem.

Now, what are the possible solutions?

Bookmarking instead of hiding tabs is NOT a solution to this conflict.


Now, you see that the bugs may not be related to tab hiding. If I rush to build an extension based on bookmarking without analyzing the bugs, it is very likely that the extension suffers from the same bugs. It means after lots of works, the result is just an inferior clone to STG that has the same disadvantages.

So this is why I am asking for a list of conflicts and performance issues. As an extension developer, I may be able to see the real reason of the bugs, and plan the solution accordingly. I've searched on the issue trackers but did not found many bugs that you described. If you have any links to the bug reports that you have issues with, please post them here.

EstherMoellman commented 5 years ago

@jingyu9575 ... first, thank you for your explanation... loved it. Second, please believe me, before your explanation I already had understood your logic. It is perfectly understandable your argument proposing (first) the analysis of bugs and their causes etc, as the right way to build a new add-on (or not). No disagreements here! So as well, I also understood your request for a list of TGAD' bugs.

It turns out that such list you requested is not simple to deliver, because users not always express themselves with the exact terminology you need. That's the reason I perfectly understood when you said you visited AMO and GitHub' pages and didn't see the reported bugs you needed. It will be difficult to find reports clearly describing something related to our "bookmarking" VS "hiding/discarding" discussion.

And here, you and I must be clear: We only care about if "bookmarking" (closing) is better or not than "hiding/discarding". This should be our first step! You said "bookmarking" won't make changes at the case of STG VS SAB. And "Houston, here we have a disagreement" (LOL). I don't have the technical explanation for you, but I have the empirical one: For weeks, we (150 users) confirmed that TGAD using "bookmarking" had bugs, had browser limitations etc, but also they had less conflict add-ons, and better browser performance when compared to TGAD using "hiding/discarding". Here @jingyu9575 should be all our agreements or disagreements. Bugs and browser limitations are common to both TGAD ("bookmarking" VS "hiding/discarding"). So this should not be our first step! But, less add-on conflicts and better performance, yeah, this should be our first step.

If you're right, and compared to "hiding/discarding", "bookmarking" doesn't change nothing, doesn't reduce the number of add-on conflicts, or doesn't improve browse performance etc... then the project of a new TGAD will die. And the contrary, if we confirm that "bookmarking" reduces conflicts or improves browser performance... then the project is alive.

You want to discover this by analyzing reported bugs. But reported bugs are not clear, and also these reports may be are about add-ons conflicts, browser performance etc, but are not related to our interest: "bookmarking" or "hiding/discarding". So, it will be difficult to try your way based on specific reported bugs/issues.

In the other hand we (150 users), for weeks extensively tested TGAD using "bookmarking", and we found that TGAD using "bookmarking" still have bugs, still have browser limitations etc, but definitely they have less add-on conflicts and better browser performance. For weeks testing TGAD using "bookmarking", we never saw the level of conflicts and issues that we saw with TGAD using "hiding/discarding". Also, browser performance was better. Simple already known facts:

I repeat, sadly today we still depend on TGAD using "hiding/discarding" only because TGAD using "bookmarking" are too basic, primitive.

So, I wonder if we can solve our debate, by you doing your own tests. Please whenever you want, take all the time your need, put 500 tabs in 30 groups in a TGAD using "hiding/discarding", and do the same with a TGAD using "bookmarking". Please, don't compare functions and options. Just compare: a) Conflicts with other add-ons b) Browser performance. If your test-conclusion will confirm that "bookmarking" doesn't change nothing... then the project of a new TGAD will die. And the contrary, if your own tests confirm our tests, and "bookmarking" still has bugs, still has browser limitations, but at least has less add-on conflicts and better browser performance... then the TGAD project remains alive!

I have not interest in improving existent TGAD using "hiding/discarding", simply because these existing TGAD are enough for me, and they can be improved by their own Devs. SimpleTabGrops is an excellent example. So, I am just interested on TGAD using "bookmarking".

Our tests show "bookmarking" is better than "hiding/discarding", and we can't change our conclusions until see different conclusions (your own tests). If by chance our tests are right, then the first step should be to take the model-add-on I presented you, and to analyze there if this potential candidate is able to be improved... for example and as I said, this add-on needs to keep user-tab-order + needs to include the 5 points I mentioned in my first comment. You may say that this model-add-on has a terrible script. Yeah, OK, but let's start from here, let's take this model-add-on and see what happens.

My way is empirical, and it doesn't demand too much: a) Do your own test. b) Confirm that "bookmarking" is better. c) Then let's analyze the model-add-on I presented you. d) If this add-on survives the analyze, then let's see if the improvements I requested are doable (keep user-tab-order + my 5 points). That's all! In a second stage, in the future, bugs and browser limitations can be analyzed in order to make new improvements.

I do recognize I might be totally wrong. And also I do recognize that you are trying the right thing from the scratch. I'm just trying to convince you that we have a shortcut: If your tests confirm that "bookmarking" changes nothing, then the project of a new TGAD died before birth. No need to analyze bugs, browser limitations etc. Just convince yourself that "bookmarking" is better, equal or worse than "hiding/discarding". And do that just by doing your simple own test. Only after that you'll be able to analyze the add-on I presented you. Right now there is no need to build an add-on from the scratch. If you convince yourself that "bookmarking" is the way, and the add-on I presented you is useful... then this will be an empiric and the easier way to start.

What are your thoughts?

Thank you again for your time and patience!

jingyu9575 commented 5 years ago

such list you requested is not simple to deliver, because users not always express themselves with the exact terminology you need

Understood.

put 500 tabs in 30 groups in a TGAD using "hiding/discarding", and do the same with a TGAD using "bookmarking"

These tests are done in Firefox 68.0.2. 30 tab groups are created with 17~18 tabs in each, so there is more than 500 tabs in total. Besides the tab grouping extension, uBlock Origin, Privacy Badger and Select After Closing Current are installed with default settings.

Simple Tab Groups (with discarding enabled): STG

Taskmgr_STG

Tab Group Switch (default settings): TGS

Taskmgr_TGS

I think there is not significant difference in performance, and the RAM usages only have about 100 MB difference.

EstherMoellman commented 5 years ago

@jingyu9575 ... with all due respect, I believe your test was "too simple". Please, allow me a short explanation:

First, in real life, user will use all the Firefox' processes he can use (specially with the next Fission' project, and considering that RAM' trend price is going down cheaper and cheaper). The new normal is going to be an average of 15 FF' processes. And if you test a TGAD with "hiding/discarding", you always will finish with at least 13 discarded tabs consuming not less than useless 500MB (that also consumes CPU, generates heat, battery is killed etc). Not to mention the TGAD "hiding/discarding", which itself consumes more CPU than a "bookmarking" one. PS: When you test TGAD, all tabs must be active, in order to allow you to see the difference between "bookmarking" and "hiding/discarding". This is a real life way test... in real life, users are going to have lot of tabs active in each group (not just one active tab per group).

In a TGAD with "bookmarking", tabs are closing, so no RAM, no CPU, no heat, no battery killed, no etc. Also is better for privacy, reducing tracking, less need of containers, less cookies, less storage, less etc. I personally use FF' 100% on RAM (no disk), so in my case I also will gain with the TGAD "bookmarking" due to less use of the disk ("hiding/discarded" saves tabs + containers + cookies etc on storage, even when FF' should be 100% on RAM).

Also, as you can see in our sample of STG VS SAB conflict, as long as tabs are hidden/discarded, they generate conflicts with other add-ons (perhaps due to FF' bugs, where storage is invaded for all the add-ons). This is happening in much less cases when TGAD "bookmarking" is used, simply because no tabs (tabs closed) less conflicts with other add-ons, no storage, no nothing.

Also, hiding/discarding tabs doesn't sanitize FF' json data-bases... they keep accumulating and accumulating data for days/weeks/months, until data goes corrupted, or browser is less responsive... tabs start to appear here and there in wrong groups... tabs disappear for no reason etc... all thede issues are reported at STG GithHub' page (which is one of the best SGAD using "hiding/discarding"). Almost nothing of this happens in TGAD with "bookmarking".

Even without tests, is known that a close tab is always better than a hidden/discarded tab, in terms of browser performance (RAM, CPU, heat, battery, disk usage etc), and in terms of privacy, security and browser stability (json data-bases sanitation). PS: FF' on RAM keeps pages on RAM, so there is no difference between RAM cache and Disk cache in terms of speed. Therefore, in terms of browsing speed, "bookmarking/closing" is almost the same as "hiding/discarding").

Good to remember that "bookmarking" doesn't need add-ons like "update discarded tabs".

But I'm not trying to convince you! I just wanted to share with you my arguments.

I think you have been with me very kind, polite and patience. And I don't want to abuse and take your precious time. So I invite you to take your time. Think about the project. If you still believe that "bookmarking" won't change nothing, please, then forget the project. I always will love you! LOL But if you change your mind, and you find a reason for a new TGAD ("bookmarking" or another one), please call me, count on me! It will be a pleasure to work and to help you.

Thanks a lot my friend, I did enjoy a lot our conversation! Big hug! : )

jingyu9575 commented 5 years ago

@EstherMoellman Well it is difficult to test then. Maybe I can make a small prototype bookmarking groups extension and let you see if there are improvements over traditional tab grouping.

I'm currently working on another privileged extension, so it will need some time.

EstherMoellman commented 5 years ago

PERFECT! :) A simple prototype will be perfect! ... @jingyu9575 , anything you can do will be great! It doesn't need to be at once the perfect full complete add-on. If you start with a small dummy add-on (pilot-test/prototype), this already will be SPECTACULAR! Any starting from your side will be great and welcome. No problem if you want to start by stages, step by step, starting from the most basic function. And please don't worry at all about timing: Do just what you can/want to do, and only when you can/want to do. Zero pressure! I'll will remain here at your disposal, in case you need my help.

I already said that I love the "clean" way you work on your add-ons. So now, makes me so happy to hear that you plan to try something with TGAD using "bookmarking". Again, I respect those users that like "hiding/discarding". But @jingyu9575 , despite all my arguments in favor of "bookmarking", if you take a look at AMO' pages, at the total number of users having TGAD with "bookmarking", this niche is much bigger than users choosing "hiding/discarding". Also the number of "bookmarking" add-ons is bigger than "hiding/discarding". So your new "bookmarking" TGAD will have a bigger niche waiting for it, with much more potential users than "hiding/discarding" TGAD. Also, "bookmarking" TGAD have more visibility, most of the independent articles are written in base of "bookmarking" TGAD (see here a recent article: https://www.ghacks.net/2019/08/16/tab-session-manager-is-an-add-on-that-saves-your-windows-and-tabs/).

Yeah, after months of testing almost all of the existent TGAD ("bookmarking" and "hiding/discarding"), I'm totally convinced that "bookmarking" is the way for less conflicts, and less negative browser impact. Sadly, as I mentioned you, most of the "bookmarking" TGAD are too primitive (I still don't know why), they are too basic... most of them behave as rough ugly session-managers... they don't behave as tab-grouping. Even the "bookmarking" add-on I pointed you (TabGroupSwitch), it also is too primitive (how can a Dev make an add-on that doesn't keep user-tabs-order?). And here is the opportunity for a new TGAD, your TGAD, a "bookmarking" TGAD but that will be behave as a tab-group. Your "bookmarking" TGAD might be simple, without fancy stuff... it just need to behave similar to a tab-group-add-on.

Please, contact me if I can help you! It will be my pleasure.

Thank you! : )

jingyu9575 commented 5 years ago

This issue has been moved to the new repo. Please continue in #2.