cheeaun / max-tabs

A no-restart Firefox extension to set maximum number of opened tabs in a window.
https://addons.mozilla.org/en-US/firefox/addon/max-tabs/
8 stars 20 forks source link

major rewrite, fixes #16 and #17 #19

Open rindeal opened 9 years ago

rindeal commented 9 years ago
robsonsobral commented 9 years ago

Hi!

I tested on 41.0a and the tab moved to the new window isn't being focused. Doesn't the window need to be activated too? Or is it a Firefox Alpha bug?

rindeal commented 9 years ago

It does and it is not. I've also noticed this behaviour. Also there seems to be a bug which causes the counter to reach one tab above limit. I don't have enough time to dig into it now, but I'll try it this weekend.

robsonsobral commented 9 years ago

Hi!

I'm testing and... It's annoying to have to wait until the page to completely load before the tab to be "moved". However, I can't figure anything different from a loop on setTimeout, but I'm afraid of performance issues.

rindeal commented 9 years ago

Hi,

docs clearly say that URL of tab is known only after the tab entered "ready" state. And as I stated in comments in the code, unless you want to implement the low level stuff to enable true moving of tabs, this is the only way of doing it, AFAIK (however, I don't know too far in this field).

BTW, which loop do you mean @robsonsobral?

robsonsobral commented 9 years ago

I'm sorry! I mean setInterval.

I was thinking on to use the open() event and keep checking until tab.readyState == "interactive", instead of wait until it's complete.

rindeal commented 9 years ago

Wow, there was an error in Matrix! I'd swear that yesterday the sentence was Once a tab's readyState has entered "complete", you can .... All right, then I think polling interval of ~300-500ms shouldn't have much impact on performance.

robsonsobral commented 8 years ago

Hi! I've testing this branch and found a bug. If the new tab is just a file, like domain.com/file.jpg, it isn't moved.

Maybe it's best to use setInterval until the URl of the tab become available.

robsonsobral commented 8 years ago

One more issue: the moved tab isn't integrated into history. It doesn't appears on "recent closed tabs" and sometimes just doesn't keep its url after reload.

It looks like this idea isn't easy to implemented after all.