Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus change does not filter pending tabs or applies closing tab #59

Open
SlugFiller opened this issue May 2, 2016 · 5 comments
Open

Comments

@SlugFiller
Copy link

Suspend tab is nice enough to allow configuring which tab to focus if the current tab is suspended. As part of its options, it allows skipping suspended tabs. This is pretty nice, because it means tabs aren't loaded if you don't want them to. But it has two problems:

  1. It considers "pending" tabs as not being suspended. Tabs with the "pending" attribute are tabs loaded with Session Manager, or Firefox's built-in session restore, which were not yet focused, and hence not loaded, to save up on start up time. They should be treated like a manually suspended tab. (Testing for the "pending" attribute on the tab should be pretty simple)
  2. It applies to suspending the selected tab, but does nothing for closing the selected tab. This creates a rift between the behaviors of these two very similar actions.

Apologies if this should have been opened as two separate issues, but they seem very closely related.

@piroor
Copy link
Owner

piroor commented May 29, 2016

It applies to suspending the selected tab, but does nothing for closing the selected tab. This creates a rift between the behaviors of these two very similar actions.

I think this is hard to be fixed because this is a bootstrapped (restartless) addon. To keep addon dynamically uninstallable, we must use only public APIs of Firefox e.g. "TabClose" event. However, Firefox changes tab selection before a "TabClose" event is fired, and we cannot know the changing tab selection is triggered by a closing of the current tab or not...

@piroor
Copy link
Owner

piroor commented May 29, 2016

And I think 96e0f6c improves the behavior partially.

@SlugFiller
Copy link
Author

Regarding that commit, shouldn't the line if (tabs.length > 0) be if (focusableTabs.length > 0)?

I'm assuming the desired behavior is that if all other tabs are pending, then the nearest/most appropriate pending tab is selected.

@piroor
Copy link
Owner

piroor commented May 29, 2016

Regarding that commit, shouldn't the line if (tabs.length > 0) be if (focusableTabs.length > 0)?

Oops!

@piroor
Copy link
Owner

piroor commented May 29, 2016

The commit 25cd63e fixes my mistake...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants