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

Current group is not saved when exiting Firefox #5

Closed jingyu9575 closed 4 years ago

jingyu9575 commented 4 years ago

This is the problem:

image

I opened Group 2, added a tab example.com then closed the Firefox window. Then I opened a new window and load Group 2. There is no example.com.

When Firefox exits all extensions will be terminated, leaving no time to update the bookmarks.

Additionally, what should happen if the user restores the previous window? Now both windows use Group 2. Which one should control Group 2's tabs?

jingyu9575 commented 4 years ago

@EstherMoellman

EstherMoellman commented 4 years ago

Yeap, for the first time now I can see the issue. And now I understand what you meant by "not saving on exit". But I can only see this happening in new additional FF' windows. I tested on main FF' window, created a group, created a tab, exited FF, and everything was there at next FF' startup. So, I can only replicate the "not saving on exit", if it is happening in a new additional FF' windows.

In this context, I ask you: Is it possible for your add-on to identify a new additional opened windows? If your answer is "yes", in this case is it possible for your add-on to open a message alerting about additional FF' windows closing and losing tabs? If your answer is "yes", then I believe this will solve the issue. It's similar to FF' option, when alerts user about losing opened tabs at FF' closing.

Another different approach: When exactly your add-on creates the bookmark? The bookmark is created when the tab is created? Or when FF' windows is closed? The second one explains why your add-on can't save the tab, because FF aborts add-on work when FF is closing. So, if it is the case, is it possible for your add-on to save the tab, at the exact moment the tab is created? (avoiding FF' window closing).

In the worse case you can't find a solution, in my opinion this should not stop you to upload the first official version of the add-on at AMO. As we talked, the main goal is to upload the add-on at AMO, not complete, but perfectly usable (bookmarking, grouping and closing). And this FF' window issue does not seem to be "critical". Please, add at the bottom of AMO' page a kind of "known issues" alert, and let's move forward.

With regards to GROUP2 at first window, and GROUP2 at second window, I believe you can solve this by: 1) Not accepting duplicated group names 2) Allowing user (with an option) to open groups in current window or new window (add-on navbar icon => right mouse click over name group => option to open at current window or new window).

What are your thoughts? Doable? If not doable, you can alert users that by default, groups always are going to be opened at active FF' window.

jingyu9575 commented 4 years ago

So, I can only replicate the "not saving on exit", if it is happening in a new additional FF' windows.

That's because you have enabled Restore previous session, and Firefox automatically restores that window. STG requires it. Probably the easiest way for this extension would be requiring the option as well.

图片

Is it possible for your add-on to identify a new additional opened windows?

Yes. I can save the group if additional windows are closed. Only exiting the browser is the problem as there is no time to save.

When exactly your add-on creates the bookmark?

When switching groups.

Not accepting duplicated group names

The extension already prevents switching to duplicate groups. However, the extension cannot prevent this:

  1. Switch to Group A
  2. Close window
  3. Switch to Group A in another window
  4. Restore the first window

Now both are with Group A. I think we can just ignore this problem and see what happens. Probably only one window can be saved, but it is really a special case.

EstherMoellman commented 4 years ago

That's because you have enabled Restore previous session, and Firefox automatically restores that window. STG requires it. Probably the easiest way for this extension would be requiring the option as well.

Totally agree! But if I well understood you, this won't solve the issue when additional FF' window is closing, right? The FF' restore previous session will restore the main windows, but new group with opened tabs are not going to be saved by your add-on, because as you said, FF aborts add-on tasks when FF is closing.

Yes. I can save the group if additional windows are closed. Only exiting the browser is the problem as there is no time to save.

Understood. In the case of having a new additional FF' window, Is it possible for your add-on to request user to change group before closing FF? If I well understood you, when group is changed, group is saved, so FF can be closed without your add-on losing tabs/groups.

I think we can just ignore this problem and see what happens. Probably only one window can be saved, but it is really a special case.

Totally agree again! I don't ignore the issue. I just believe it is not critical. As I said, adding an alert message at AMO' page, informing users about this special case, it might be enough. Then with time, if you find a workaround, you may improve a solution for this issue.

PS: Changing subject... why STG can bookmark "about:" FF' pages, and your add-on can't?

jingyu9575 commented 4 years ago

v0.1a1 will save the group if additional windows are closed.

The extension still does nothing if Firefox is exiting. It now asks the user to enable Restore previous session on the first install (same as STG).

Please test v0.1a1 and see if there is any other serious issues. If not, I think it is time for an alpha-release on AMO.


why STG can bookmark "about:" FF' pages, and your add-on can't

Mine can bookmark them but cannot reopen them. STG doesn't need to reopen, as it only hides and shows them.

EstherMoellman commented 4 years ago

... veeeryyyyyyyyyy niceeeeeee, you're a Genius!... congrats! Well done! I agree with you that, at first glance, everything seems ready for the first official launch at AMO. Everything seems pretty stable at this stage. Of course, issues still can appear, and new features still can be added. But right now the 3 elementary functions (bookmarking, grouping, closing) seem to work fine. It's official: THE ADD-ON IS USABLE.

Before official launch, I just have a question about "active" and pinned "tabs": In the future will be tremendously useful if you incorporate into TabsToBookmarkGroups, another fantastic add-on of yours: SelectAfterClosingCurrent. This fusion is a must! But if you don't want to do that, don't worry, users can have same functions using both add-ons.

However, if I use both add-ons, and if I uncheck "exclude pinned tabs" at options (TabsToBookmarkGroups), every time I go into a group with pinned tabs, even if the pinned tab is not the active tab, pinned tabs are loaded with the last active tab. Again, this is happening using or not SelectAfterClosingCurrent. The expected behavior in this case should be to load just the last active tab, pinned or unpinned.

Another undesirable behavior happens, when I check "exclude pinned tabs" at TabsToBookmarkGroups, I choose "pinned tab" as last active tab at SelectAfterClosingCurrent, but when I open a different group at TabsToBookmarkGroups, the last unpinned active tab is loaded (when should be loaded only pinned tabs).

In brief, IMO, those are the expected behaviors: 1) If user checked "exclude pinned tabs" at TabsToBookmarkGroups, when a group is opened, if the last active tab is pinned, then the pinned tab should be the only loaded tab. 2) If user checked "exclude pinned tabs", when a group is opened, if the last active tab is unpinned, then the unpinned tab should be the only loaded tab. 3) If user unchecked "exclude pinned tabs", when a group is opened, if the last active tab is pinned, then the pinned tab should be the only loaded tab. 3) If user unchecked "exclude pinned tabs", when a group is opened, even if the last active tab is an unpinned tab, then the pinned tab should be the only loaded tab.

In simple words: a) If pinned tabs are included in a group, only last active tab should be loaded, pinned or unpinned, not both. b) If pinned tabs are excluded, only pinned tabs should be loaded... until user installs TabsToBookmarkGroups and changes this behavior.

jingyu9575 commented 4 years ago

Please continue at #6. I prefer creating new issues for new topics, to keep each issue short and easy to navigate.