Drive4ik / simple-tab-groups

Create, modify and quick change tab groups. Inspired by the Tab Groups app :)
https://addons.mozilla.org/firefox/addon/simple-tab-groups/
Mozilla Public License 2.0
1.2k stars 96 forks source link

Grouped tabs lose their tabs in response to closure of Firefox's last window in macOS (note that in macOS the application remains open after all windows are closed) #716

Open saper17 opened 4 years ago

saper17 commented 4 years ago

Describe the bug When I close a window that is showing the tabs from a group it often, but not always, results in all tabs from all groups being deleted.

To Reproduce I start Firefox and a new window opens, not in any group.

I select a group from the Simple Tab Groups menu and the tabs from that group appear in the window; the Simple Tab Groups icon shows the color of the group. In addition a dropdown message from Firefox appears saying "Access Your Hidden Tabs: An extension, Simple Tab Groups, is hiding some of your tabs. You can still access all of your tabs from \/" with the choices "Disable Extension" and "Keep Tabs Hidden". I do not choose either option and the message disappears with any interaction.

I then close the window because I do not need to work with that group anymore. A message appears "Close tabs? You are about to close 196 tabs. Are you sure you want to continue?" with the option "Cancel" or "Close Tabs".

If I select "Cancel" then the window remains. If I select "Close Tabs" then the window disappears. When I open a new window and check the Simple Tab Groups men I see that all 20 groups list 0 tabs.

If another window is open before doing the above, the number of tabs in the warning can vary considerably and also sometimes all tabs are similarly erased and sometimes they are not.

Expected behavior When I close a window containing a group the window disappears but tabs should not be deleted from that group and all other groups.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

lamyergeier commented 3 years ago

@Drive4ik I am also facing the same issue

On Ubuntu 20.04.1, Firefox 82

andreagrax commented 3 years ago

@Drive4ik same issue on ubuntu 20.04.1, also with Firefox 83

richard-ling commented 3 years ago

I am also facing this issue, have just noticed in the last hour but not sure when the loss occurred. I have lost the contents of all my tab groups, so I would like to restore all the lost tabs, from backup or otherwise, but I don't want to overwrite the existing groups because I don't want to lose tabs and groups created more recently. I guess what I need is a way to merge a backup JSON into the existing groups without replacing them. I will then have to painstakingly sort through all the tabs to work out what I previously deleted, but that is better than losing all the tabs.

Macos 10.15.7 Firefox 83.0 64-bit SimpleTabGroups version 4.7 updated November 24, 2020

richard-ling commented 3 years ago

BTW the symptoms were very similar to what @saper17 reported -- after creating some new groups and moving a whole load of existing tabs into them, I switched to one of the new groups and noticed it came up empty. Then I noticed most of the other ones I'd just created were empty too, and so were a lot of older groups I had not used in months. When I tried to close the window (which was only showing the default new tab) I got a message that I was about to close some large number of tabs (that were not visible). I couldn't work out how to show them, so (stupidly perhaps), I clicked close.

richard-ling commented 3 years ago

Unfortunately I've discovered that even the earliest backup in my backups folder does not contain any tabs for the older groups. I checked by opening the oldest JSON backup in a text editor and seeing the empty tabs array in the older groups.

So it seems like the loss (or perhaps, the first of several losses) happened longer ago than my oldest backup.

I expect that means all the contents of these older groups are lost forever.

maiconandsilva commented 3 years ago

Same here.

Browser: Firefox 84.0 (64-bit) Operating System: Kubuntu 20.04

I'm using version 4.5 while this is not fixed (It stops working from version 4.5.1).

link to download a specific version: https://addons.mozilla.org/en-US/firefox/addon/simple-tab-groups/versions

Thanks for this amazing addon.

grahamperrin commented 3 years ago

Is the required preference set?

image

maiconandsilva commented 3 years ago

In my case, I can confirm the preference was set when it was not working. I had checked that several times because of the instructions displayed after the extension was installed. I have been using an older version so I cannot say much now. Later I will try to reproduce the issue again. Thanks.

grahamperrin commented 3 years ago

Thank you. Is it possible that at some time you inadvertently added, or enabled, an extension that conflicts with Simple Tab Groups?

https://addons.mozilla.org/addon/simple-tab-groups/ lists six such extensions; there may be more. This is not to say that losses will occur in cases of conflict, but the open-ended nature of the list should be borne in mind.

saper17 commented 3 years ago

In my case the "Restore Previous Session" preference has always been set and I do not have any of the conflicting extensions mentioned. I have not noticed the problem as much the past month (possibly because I allowed many windows to build up) but yesterday after I carefully deleted windows I no longer needed at the moment, the problem re-occurred twice.

My Firefox version is now 85.0.2.

maiconandsilva commented 3 years ago

@grahamperrin, I have onetab installed. That may be the problem. I didn't see it in the description.

Can you make that session which lists the extension conflicts bold or somewhat more visible in the installation instructions perhaps? I think that would help people to troubleshoot some errors before reaching out to you. Anyways, this is just a suggestion, If something like that already exists just ignore me ;). Thank you very much.

grahamperrin commented 3 years ago

@saper17 thank you, and recalling your opening post:

… 20 groups list 0 tabs. …

– when any number of groups is unexpectedly empty, are any of the affected tabs hidden and non-grouped?

image

grahamperrin commented 3 years ago

To affected users: please consider providing a list of enabled extensions.

Add-on List-o-matic 9000 can present what's required:

– thank you.

maiconandsilva commented 3 years ago

List of Extensions (Sun Feb 21 2021):

Auto Tab Discard 0.4.1 Behind The Overlay Revival 1.8.3 Bitwarden - Free Password Manager 1.48.1 Cookie AutoDelete 3.6.0 Dark Reader 4.9.27 Decentraleyes 2.0.15 Dictionary Anywhere 1.1.0 DuckDuckGo 1.1 Enhancer for YouTube™ 2.0.101 Facebook Container 2.1.2 Fake Filler 3.3.1 Flagfox 6.1.35 HTTPS Everywhere 2021.1.27 Imagus 0.9.8.74 Mate Translate – translator, dictionary 8.1.3 OneTab 1.50 Plasma Integration 1.8.0.1 Random User-Agent 2.2.13 Request Control 1.15.5 Simple Tab Groups 4.5 Smart Referer 0.2.15 Smart Tab Mute 1.0.1.1 uBlock Origin 1.33.2 Unshort.link - Free Link unshorten services 1.6 Video Resumer 1.2.3 Vimium C - All by Keyboard 1.88.2 Wikipedia (en) 1.1 Wikiwand: Wikipedia Modernized 5.1.3 YouTube Focus 1.2

saper17 commented 3 years ago

List of extensions:

DownThemAll! Simple Tab Groups SQLite Manager

Also when my tabs are missing, this occurs in all groups maintained by Simple Tab Groups. You asked are any of the missing tabs "hidden". I don't know how to "hide" a tab but I gather that Simple Tab Groups hides tabs within a group that is not displayed in an open window. Given that yes: I have a window open for one or two of my groups and no window for the other groups, so I imagine the tabs in those other groups are hidden. When I close these one or two windows and open a new window I see that all the tabs in all the groups, not just the one or two previously open, have disappeared.

As for non-groups tabs, I can have a window open with a non-grouped tab alongside a window showing a group of tabs. When I close both windows, either order by a test, so that there are no windows open in Firefox, and then open a new window in Firefox, the app icon shows 0 tabs in all of my groups.

Thank you for looking into this!

grahamperrin commented 3 years ago

… non-groups tabs, I can have a window open with a non-grouped tab …

Please try this:

  1. use Simple Tab Groups to perform a backup
  2. close all other windows
  3. open two new windows
  4. in one of the two new windows, view this page
  5. in the other new window, view https://firefox-storage-test.glitch.me/
  6. exit/quit Firefox
  7. start Firefox
saper17 commented 3 years ago

Ok I tried this but I had problem in steps 2 and 3. Specifically in step 2 I closed all windows (Firefox was still running as usual on a Mac). When I opened two new windows I checked and saw all tabs managed by Simple Tab Groups had disappeared as in my original post.

So I restored Tab Groups from the back-up and tried again, this time never closing all windows. I arranged that i had two windows open, one displaying the GitHub page for Simple Tab Groups (was that what you wanted in step 4?) and the other displaying the website from step 5. After steps 6 and 7 the same two windows appeared. The second window displayed:

Overview: Storage is working. This is the same version (85) as the last time you loaded this page. Specific Subsystem Statuses:

LocalStorage Good: Totally Working. (fullyOperational) QuotaManager Good: Totally Working. (fullyOperational) IndexedDB Good: Totally Working. (fullyOperational) Cache API Good: Totally Working. (fullyOperational)

Debug Info:

{ "v": 1, "curVersion": 85, "prevVersion": 85, "ls": {}, "qm": { "lastWorkedIn": 85 }, "idb": { "persistentCreatedIn": 85, "persistentLastOpenedIn": 85, "clearDetectedIn": 0 }, "cache": { "firstCacheCreatedIn": 85, "unpaddedOpaqueCreatedIn": 0, "paddedOpaqueCreatedIn": 85 } }

saper17 commented 3 years ago

Here is a simpler sequence of steps that causes the problem. Start Firefox. Close every window (not tab) that appears by (in MacOS) either using the menu option or by clicking the red button in the upper left or with the command sequence Shift-Command-W. Note that the closed window or windows did not have to be displaying any of the groups controlled by Simple Tab Groups. After having done this, open a new window. Now the Simple Tab Groups menu shows that all groups have 0 tabs in them.

grahamperrin commented 3 years ago

OK, please repeat the seven steps at https://github.com/Drive4ik/simple-tab-groups/issues/716#issuecomment-783147315 – without performing any other step.

I'd like to know whether the windows populated at steps 4 and 5 – without using Simple Tab Groups – are populated following step 7.

If you can, please provide a screen recording. Thanks.

saper17 commented 3 years ago

Please explain further so I do this right:

MPeti1 commented 3 years ago

This might help in debugging or finding a workaround: I have been using the addon for a few monnths now, I switch between groups multiple times a day. Each of these groups have less than 50 tabs. I also have a huge group of 1k tabs, but I don't usually switch to/from that, except if by accident, instead it's open in a separate window all the time. I usually close Firefox with Ctrl+Q (on Windows, on OSX it might be a bit different), which is the shortcut for the Exit option at the bottom of the hamburger menu. I use this so it won't forget which windows did I have open.

I haven't noticed any tabs to be disappearing, like in the smaller groups I think I would have noticed, and the mega-group is so near to 1k that if it's count would change, I think I would notice it.

I use FF 85 with a ton of other addons and about:config customizations. I really hope that I won't stumble into this as my workflow is now based around this addon (and the tabhiding functionality).

@saper17: @grahamperrin asked this earlier, but the answer wasn't assuring me that you thought about the same thing: If you open the STG menu, scroll to the bottom (1) if there is a scrollbar, do you see that Show other tabs line (2)?

image

grahamperrin commented 3 years ago

https://github.com/Drive4ik/simple-tab-groups/issues/716#issuecomment-783650580

* in step 2, it says "close all other windows".  What is the window that should be left open?

The window to preferences for Simple Tab Groups.

* In your question "whether the windows populated at . . .", what do you mean by "populated"?  

Not empty.

These windows will only have one tab; are you thus asking if the two windows are displaying the same website as before?

Yes.

saper17 commented 3 years ago

Thanks for the clarification! I have made are two .mov files made with the Quicktime Player on MacOs

The first named "SimpleTabGroups_Test_2_24_2021.mov" shows me following the 7 steps you asked for. Nothing seems to be wrong: after restarting the two windows you asked me to create seems to be showing the same data.

The second named "DemonstrationOfSimpleTabGroupsProgram_2_24_2021.mov" shows the problem: it starts with one window and shows how all groups have varying numbers of tabs; that window is then closed; another window is then opened; now all groups have 0 tabs.

Unfortunately the first movie is 43.5 MB and the second is 19.5 MB. The limit for attaching here seems to be 10 MB. How would you prefer I deliver them to you?

grahamperrin commented 3 years ago

@saper17 any file sharing service, I guess.

Which version of Firefox was in use when you made the recordings: 85.0.2 or 86.0?

saper17 commented 3 years ago

Version 86.0 of Firefox. You can download the movies at

https://cloud.math.duke.edu/owncloud/index.php/s/GhkS4NyDCwd86gY

for two days.

grahamperrin commented 3 years ago

Thank you.

DemonstrationOfSimpleTabGroupsProgram_2_24_2021.mov makes the issue very clear.

Four frames from the screen recording. First, the intact set of groups:

image

Closing the last window:

image

Opening a new window:

image

All groups are empty:

image

grahamperrin commented 3 years ago

Observations

On macOS – where some types of application continue to run after closure of the last window – the application design can be problematic to:

Neither of these questions gained an ideal answer, maybe because what's required can not be achieved without hacking, and macOS might refuse to run a legitimately hacked app:

Workaround

At the foot of when i close my firefox on my MAC.. i lose my pinned tabs.. how do i fix this. | Firefox Support Forum | Mozilla Support (2019–2020, archived), @jscher2000 wrote:

Maybe as a short term workaround someone could create an add-on for Mac users …

– here's an extension that he created:

If the default behaviour – automated appearance of the preventative tab in every regular window – becomes an issue, you can set a preference for the extension to not do this. If you disable the automation, remember to click the toolbar icon (the red cross) in at least one window.

Essentially

In any preventative tab, click one of the these three buttons:

image

Towards a fix

I'm not a developer, but I don't imagine a fix for this from the developer(s) of Simple Tab Groups.

What's probably required is an enhancement to Firefox – an option (on macOS, not a default) to quit when the last window is closed. Quit-on-close is the norm with Firefox on FreeBSD.

It's very likely that someone has already raised a relevant bug in Bugzilla@Mozilla however, it's the type of thing that might be difficult to find in the midst of noise from other bugs with similar keywords.

Wishful thinking: since Simple Tab Groups is a Mozilla-recommended extension, this should help to prioritise an enhancement.

grahamperrin commented 3 years ago

History menu options

From https://github.com/Drive4ik/simple-tab-groups/issues/434#issuecomment-519984986 (2019-08-09):

… you can close all windows on mac but without closing the browser itself - accordingly all tabs are closed and no longer be contained in groups. But instead of creating a new window, you can restore the old one …

The History menu of Firefox 86.0:

Without closing a last window

The screen recording below shows Firefox reopening (restoring) one of three windows.

In the window:

https://user-images.githubusercontent.com/192271/109093085-aae0b500-770f-11eb-8fee-479381f0d717.mp4

This is:

saper17 commented 3 years ago

@grahamperrin Thanks for clarifying the problem. Yes, you may post some screenshots from the movie. However what is happening should be clear now that you have noted that MacOS allows an application to continue with no windows: close all windows in Firefox (Shift-Command W); the application continues to run; start a new window (Command N); observe that all saved tabs in groups have disappeared. (At the time I first posted the problem it appeared to be more subtle; I will write back if I discover it is indeed more subtle that this.)

Thanks also for the suggested workaround. Of course another workaround is for me never to close all windows in Firefox! I can readily see this may be an issue that should be fixed in Firefox. Thanks very much for your help.

grahamperrin commented 3 years ago

https://github.com/Drive4ik/simple-tab-groups/issues/716#issuecomment-782888817

@grahamperrin, … Can you make … extension conflicts bold or somewhat more visible in the installation instructions perhaps? …

👍 to the wish, however:

Thank you everyone

grahamperrin commented 3 years ago

https://github.com/Drive4ik/simple-tab-groups/issues/716#issuecomment-731730907

… Ubuntu 20.04.1, Firefox 82

https://github.com/Drive4ik/simple-tab-groups/issues/716#issuecomment-732690605

… ubuntu 20.04.1, also with Firefox 83

@anishmittal2020 @andreagrax does Ubuntu (like macOS) allow Firefox to run after closing all Windows?

lamyergeier commented 3 years ago

@grahamperrin I don't think so.

vitusson commented 3 years ago

does Ubuntu (like macOS) allow Firefox to run after closing all Windows?

Can't speak for Ubuntu, but Debian doesn't. Quit is quit.

grahamperrin commented 3 years ago

@saper17 please, might you change the title of this issue? To more accurately reflect the (tentative) conclusion:

– or words to that effect.


@vitusson thank you for the Debian Linux context.

Distinct from actively quitting, the context here is closure of the last window – typically (depending on desktop environment configuration) Control-W or clicking the close box. Maybe also Alt-F4, although I have not tried that in the context of this issue.


My own brief tests with XFCE on Manjaro Linux did sometimes show quit in response to closure.

At some points during the tests I became aware that my view of a single-tab window was not closing in response to multiple consecutive uses of Control-W.

For a while, I wondered whether protective code was written into the extension by @Drive4ik to prevent inappropriate closure on systems such as Apple's.

This non-closure behaviour was not consistently reproducible, so I began to wonder about the number of tabs that might have been hidden before I had begun repeatedly (and quickly) keying Control-W. In retrospect, I imagine that what I perceived as a single-tab window was, truly, a window of (let's say) four or more tabs – most of which were hidden – and each strike of Control-W closed just one tab without revealing any more than one of the others.

Honestly, I wasn't paying attention to tab content or group context. These rounds of tests were not only brief, they were also rushed (paying insufficient attention to tab content or group context) and non-methodical.


If this issue is truly macOS-specific, then there remains the question of why comparable symptoms may be found, sometimes, with distributions or re-brands of Firefox that do exit/quit in response to closure of the last window. I suspect that in these cases, explanations may be found in other open issues, not all of which have a conclusive diagnosis.

saper17 commented 3 years ago

Regarding @grahamperrin experiments on Manjaro Linux I have noticed similar inconsistent behavior on macOS Firefox. Namely if I have a single window with one tab, issuing Command-W (close tab) sometimes closes that window. Other times Command-W deletes the tab and replaces it with a new tab within the same window; this can be done repeatedly. The reason I can tell something is changed is that my new windows default to displaying my home page while new tabs display Firefox's default page. This odd later behavior only occurs in my experience when using Simple Tab Groups. (Incidentally I am not using Prevent Closing Window.) The connection with Simple Tab Groups is clear since when the tab disappears and a new one is re-incarnated, the "Access Your Hidden Tabs" popup from STG appears. I don't know if there were hidden tabs being deleted nor how easily to find that out---if there were that would be a bug to my mind since issuing Command-W should not unknowingly to the user delete a tab.

grahamperrin commented 3 years ago

Without thinking too deeply about it … I imagine that behaviour might differ depending on whether the tab to be closed (and/or the tab to subsequently be in front) is managed by Simple Tab Groups, or not managed (non-synchronised).