sblask/webextension-open-tabs-next-to-current

Scrolling the tab bar when opening a new tab next to current

vstepaniuk opened this issue · 18 comments

Your add-on does the job, but

  • it firstly opens the tab as the last one, and only then "moves" it next to the current (JUMP)
  • it scrolls the tab bar in order to make the newly opened tab leftmost visible (SCROLLING)

Could you please repair this?

Ubuntu 16.04.2 (64-bit), Firefox 53.0.2

The add-on has always worked like this (moving the tab) but now with the new API (which is the only one Mozilla leaves us with) it is visible. For issue number 2, see #24 Nothing much I can do about either of them unless I completely change the approach of this add-on. I could potentially do the same as I do in this add-on: https://github.com/sblask/webextension-open-tabs-in-foreground But this would only affect tabs opened with Ctrl-click or middle click. No way to have the right position for:

  • tabs opened from bookmarks
  • tabs opened from normal clicks (triggered by javascript or using a target)
  • new tabs opened with Ctrl-T
  • Firefox tabs like Add-Ons or Preferences

and possibly others. I think that would make the add-on very unintuitive...

I came here to report this exact same thing and was hoping it wasn't the stupid Firefox API. Oh well.

Thanks for making this addon!

Thinking about it, I don't actually do the same thing as before. I used to listen to TabOpen whereas now it's onCreated. So the tab wasn't opened yet when I made the modifications and presumably that's the reason why there was no jumping around. Now there is only onCreated, no onCreate, so not much choice. The lack of events or bad event ordering in webextension bites me for some of my other add-ons too...

Well seems like Mozilla is at fault here. Isn't the whole point of improving an API to provide support to existing add-ons? Seems like a step back removing an event listner

Well, I have to say, it's easier to write a webextension than any of the ways there were before. But the cost is a reduced API and scrapping years of add-on development...

@sblask , did you file a bug about the API problem on bugzilla? It would really help us prioritize and eventually fix the issue :-)

@Dexterp37 what API problem do you mean? The event order and specifics are not part of the API. I opened issues for other things (see https://bugzilla.mozilla.org/show_bug.cgi?id=1366290 and https://bugzilla.mozilla.org/show_bug.cgi?id=1369667) and the outcome doesn't get my hopes up. I also asked for new APIs: https://bugzilla.mozilla.org/show_bug.cgi?id=1246706 and it got denied, so I won't bother.

Otherwise, I actually consider not being able to see all tabs at once and having to scroll the tab bar a bug and once the add-on that fixes it for me stops working I will switch to something else.

The jumping is the same in Chrome, but less visible because it's not as slow as Firefox...

the lack of events or bad event ordering in webextension bites me for some of my other add-ons too...

I was talking about this. I'm not directly involved in the API work but, since I'm using your addon, I was just trying to help ;-)

I see your frustration for bug 1246706, but I also see that the other seem to be moving.

I think this bug affect me using the imacro add on to create a new tab; I have to stay on version 1.1.5 to avoid the bug. I have recorded the action:

Setup: There are at least two tabs, and the current tab is on the left side or second last from the right.

The imacro code is:

TAB T=1
'open 2 tab
TAB OPEN
TAB OPEN

'go to tab 2
TAB T=2
'open google page
URL GOTO=www.google.com
TAB OPEN
TAB T=3
TAB T=1

The result should be google page next to the current select tab, the old version did the job, but after version 1.1.5, everything broke, the google tab becomes the 3rd, not the 2nd.

Should be work like this
https://www.screencast.com/t/CT8WKpiX

Newest version bug - Google tab page on the 3rd tab on the 2nd tab.
https://www.screencast.com/t/Qie7vgtk

I think nightly has made an api to be able to open tab next to current.

@rayman89 you'll have to be a bit more specific...

[design-decision-approved] is not implemented.

If this bug get through, there won't be a need for this extension anymore. It took long enough, but it seems like there will be a preference at some point.

Hi! I have an idea. There is already a behavior for any link I open from current tab: firefox will open them after current tab. Is there any way in firefox API to trigger that behavior? Use first found link on the current page (or even create it after body tag open for example) then call clicking it "open in new tab" and then overwrite new tab url. Maybe then this feature can be implemented with the current API.
p.s. I'm struggling because of this scrolling behaviour almost every day

It's not the same thing and even if, there are several cases where this wouldn't work at all AND you would probably still get scrolling.