rNeomy / tab-suspender

Automatically suspend (hibernate) inactive tabs to free up system resources; This project is discontinued in favor of https://add0n.com/tab-discard.html
http://add0n.com/tab-suspender.html
Mozilla Public License 2.0
113 stars 32 forks source link

Tab Suspender compatibility with Session Manager #31

Open grahamperrin opened 7 years ago

grahamperrin commented 7 years ago

Tab Suspender 0.1.8, Session Manager 0.8.1.13.

I prefer to things to not restore automatically when Firefox starts. Tab Suspender seems to not respect that preference.

The typical symptoms, after a session with hundreds of tabs (one pinned) was saved at quit time, seemed to be:

An example

From a few days ago, 2017-07-20

08:48

2017-07-20 08 48 36

08:56

2017-07-20 08 56 43

aimalz commented 7 years ago

I have this problem, too, with Firefox 54 launched from the command line with firefox -P -no-remote (default built-in profile manager) and Tab Suspender 0.1.8. Normal behavior without Tab Suspender is to open a single window with a single tab to restore the session. With Tab Suspender, some tabs appear as additional tabs in that initial restore session window. (I can't figure out why some tabs and not others are affected. It's not all the ones that were suspended in the previous session, it's not all the ones that were suspended in the session in which I installed Tab Suspender, it's not all the ones I closed while in the suspended state in the previous session, and it's not all the ones that were loading when the last session ended. I can't figure it out!) If I wait long enough, the tabs "load" to the extent that there is visible text but they remain suspended. If I do not close them all (thankfully easy with Tree Style Tabs), they hang around in a new window when I restore the session.

grahamperrin commented 7 years ago

2017-01-13:

… option to disable the extension's session restore. This option is off for both Firefox and Opera browsers by default. …

I wonder whether I misunderstood an on-screen option.

Maybe review this after Firefox 55 is released.

grahamperrin commented 7 years ago

… review this after Firefox 55 is released.

With 55.0.1 and four tabs in a group before enabling the extension, enabling the extension caused addition of ninety-nine tabs to that group:

2017-08-13 03 04 05 firefox

(There's a Clear Tabs count of 103 (4+99) in the menu bar.)

grahamperrin commented 7 years ago

… after waiting more than an hour I abandoned hope of Firefox responding, I killed the process:

2017-08-13 04 18 07 preparing to kill firefox


I re-launched Firefox, expecting just one tab (restoration of nothing). Instead, numerous tabs appeared.

Whilst Firefox apparently attempted to load those tabs (the circular icons rotated) I aimed to manage extensions –

2017-08-13 04 27 44 after launch trying to manage add-ons

– but Firefox failed to present about:addons:

2017-08-13 04 28 30 failing to list all tabs

After more than ten minutes I abandoned hope of Firefox responding, killed the process and then:


Without Tab Suspender

I relaunched Firefox, it behaved properly, as it should after a kill:

Then:

  1. escaped from Session Manager
  2. opened about:addons
  3. used the tools menu to view recent updates
  4. in a new tab, https://addons.mozilla.org/firefox/addon/tab-suspender-tab-unloader/
  5. added Tab Suspender
  6. immediately Control-Page Up to review the list of recent updates
  7. immediately disabled Tab Suspender
  8. enabled Auto Unload Tab.

… addition of ninety-nine tabs …

A later Session Manager view of that session, 753 tabs at the time of the kill:

2017-08-13 05 16 47 session manager - mozilla firefox

After excluding the about:blank tabs I got a true count of the number of tabs that were open before Tab Suspender began adding: 472. So the true number of additions was much greater than 99:

– I say "at least" with an assumption that as Firefox stopped responding, so session storage might have lost the ability to truly count the number of tabs that was being added/opened.

With Auto Unload Tab (in lieu of Tab Suspender)

No problem with this legacy extension. One of fifty-seven active extensions. From about:support:

2017-08-13 05:45 about:support text.txt

2017-08-13 05:45 about:support raw.json.zip

rNeomy commented 7 years ago

As of version 0.1.9, there will be no tab restoring upon statup. The extension opens a new window to allow user select tabs that need to be restored. This should fix this bug. You can try the beta version here: https://addons.mozilla.org/en-US/firefox/addon/tab-suspender-tab-unloader/versions/beta

Note that your "Session Manager" extension should have been configured to not to store "moz-extension://" tabs.

grahamperrin commented 7 years ago

… "Session Manager" extension should have been configured to not to store "moz-extension://" tabs.

As far as I know: non-extended Firefox can not be configured to exclude such tabs when saving sessionstore.js and (comparably) it's not possible to configure Session Manager for exclusions.

HamidZaeri commented 7 years ago

I just restarted my firefox window and what happened, a mess with my tabs, all of them closed and I had to open them by tab suspender window and it changed sort of my tab, oh no. Why not keep it like before so tabs stay there after close and open ff?

rNeomy commented 7 years ago

It turned out that when there are many open suspended tabs, restoring them causes FF to slow down. So we do restore through a session restoring window. The order of tabs should be kept intact or at least this is what it is supposed to do!

perdolka commented 7 years ago

So we do restore through a session restoring window.

Perhaps, a compromise solution would be to add this settings option: at start, load ALL tabs from "session restoring list" automatically, without opening the "session restoring window" ? And another option - just like now.

CPngN commented 7 years ago

As of version 0.2 Mac, when I restart Firefox, all of my suspended tabs are just gone. cmd-shift-T reloads them from the recently closed list. I got no session restore window thing, and when I did yesterday, it didn't make sense or seem to restore anything. I also use sessionmanager, but of course in 1 more version that will be going away, so.... yeah.

irvinm commented 7 years ago

@rNeomy any idea the root cause behind the performance penalty of having "many open suspended tabs" or even if it is solvable? I know power users who have 200+ tabs (heck I have had 700+) will have 95%+ of them suspended at any given moment such that any time your add-on is updated or Firefox is updated they will have to deal with this situation.

Maybe there is a side but related question. I believe there will be a WebExtension API soon to "discard" tabs. This will remove the tab from memory, but retain them in the tab strip.

https://bugzilla.mozilla.org/show_bug.cgi?id=1322485

Any plans to use this when it lands? This would make things much more straight forward and would likely solve the performance issue.

irvinm commented 7 years ago

Just an update for everyone ... looks like they have approved the "discard" tab functionality but it missed the window for FF57 but will land in FF58.

https://bugzilla.mozilla.org/show_bug.cgi?id=1322485#c49

@rNeomy, do you think you can use this implementation to simplify your work and possibly fix the performance issues of when the add-on\Firefox upgrade when tabs are suspended?

rNeomy commented 7 years ago

@irvinm I haven't try that yet. Though if the API is available the extension should use it unless user has unchecked the option in the settings page. https://github.com/rNeomy/tab-suspender/blob/master/common.js#L197

This was implemented on 0.2.4

rNeomy commented 6 years ago

This is going to replace Tab Suspender soon. https://addons.mozilla.org/firefox/addon/auto-tab-discard/

Only supports the native method and will solve most of the issues we are facing here