ClassicTabs icon indicating copy to clipboard operation
ClassicTabs copied to clipboard

When closing a tab: Activate the last active tab - broken

Open sorenfeodor opened this issue 7 years ago • 38 comments

In the newest version of opera for linux (57.0.3098.76) I do not get back to the last active tab when closing a tab (and I really miss it)

sorenfeodor avatar Dec 03 '18 11:12 sorenfeodor

Have the same problem :(

Oswalt-Gottfried avatar Dec 05 '18 22:12 Oswalt-Gottfried

Same problem for me as well. Can't think of any way to check for solutions, anyone had any luck? (I'm using Opera for Windows.)

MeneGR avatar Dec 16 '18 00:12 MeneGR

Have the same problem.

zdenekvecera avatar Dec 26 '18 12:12 zdenekvecera

I'm guessing that Opera changed the order of what happens when a tab is closed yet again. I'll try to figure out what's wrong.

joelspadin avatar Dec 27 '18 04:12 joelspadin

Great Thanks in advance for repairing this issue! It was very convenient feature and is not working now for me as well..

PavelKucherneko avatar Jan 04 '19 18:01 PavelKucherneko

Yeah, I've had the same problem for a few weeks now too. Would be awesome if you could fix it - I don't know why any browser wouldn't have this as the default behavior.

HSVGuy avatar Jan 10 '19 00:01 HSVGuy

Any chance this could get fixed? :(

arturo182 avatar Feb 20 '19 22:02 arturo182

I am working on this, but it's going slowly because the code is ancient and I'm updating it to support hot reloading, which will make finding and fixing the actual issue much easier. I just got this working last weekend.

joelspadin avatar Feb 20 '19 23:02 joelspadin

I rewrote most of the extension, and I think I've fixed it. It needs a lot more testing though. If anyone's interested in helping with testing, I'll release a beta version soon.

joelspadin avatar Mar 16 '19 23:03 joelspadin

I can help with testing.

Oswalt-Gottfried avatar Mar 17 '19 00:03 Oswalt-Gottfried

I would also be happy to test.

HSVGuy avatar Mar 17 '19 01:03 HSVGuy

If you need more, I'm here too!

MeneGR avatar Mar 18 '19 00:03 MeneGR

I'll be happy to test as well

sorenfeodor avatar Mar 18 '19 09:03 sorenfeodor

Many thanks! I am ready for testing too. Very convenient feature I should say. Was..

PavelKucherenko avatar Mar 18 '19 16:03 PavelKucherenko

Beta is ready: https://github.com/ChaosinaCan/ClassicTabs/releases/tag/v2.0.0-beta.0

To install it, open the extension page (Ctrl+Shift+E) and drag and drop classic-tabs.v2.0.0.opera.crx.zip onto it. This beta won't upgrade the old version, so make sure you disable the old one and update your settings in the new one.

joelspadin avatar Mar 19 '19 01:03 joelspadin

Unfortunately, it is not working for me.. In the "When closing a tab" section I set "Focus the last-active tab", but after some tab is closed the focus is either on the right tab (to the closed one) or on the last (left) tab if the closed tab was the last tab. (Opera Version:58.0.3135.107, System: Windows 10 64-bit)

PavelKucherenko avatar Mar 19 '19 10:03 PavelKucherenko

I confirm @PavelKucherenko, I have the same problem.

Opera 58.0.3135.107, Windows 10 64 bit I also tested it on a clean installation in VirtualBox.

zdenekvecera avatar Mar 19 '19 10:03 zdenekvecera

Okay. I'm not able to reproduce that on my PC, so I'll need to add a way to log what's happening on your machines so I can figure out what's different.

There are also some "works on my machine" timing values, and I might need to wait longer on slower PCs. I'll add some settings to tweak those too.

joelspadin avatar Mar 19 '19 15:03 joelspadin

Yep, that bug exist. Opera 58.0.3135.107, Ubuntu 18.04.

Oswalt-Gottfried avatar Mar 19 '19 15:03 Oswalt-Gottfried

I might need to wait longer on slower PCs.

I have a mobile workstation DELL Precision 5520 (Intel Core i7-7820 HQ @ 2,9 GHz, 16 GB RAM). So I don't think it will be slow, but ok :)

Thanks!

zdenekvecera avatar Mar 19 '19 15:03 zdenekvecera

I'm testing on an i5-8600K @ 3.6 GHz with 32 GB of RAM. :)

I wouldn't expect that to make a difference, since the PC I originally wrote this extension on was slower than yours, but maybe Opera has gotten slower too.

It's also possible that the tab events happen in a completely different order on different PCs. On my PC, I get notified that a tab was closed after Opera has already focused the tab it wants to focus next. To handle that, I'm tracking the order in which tabs get focused. If Opera just recently focused a different tab and the closed tab was the second most-recently focused tab, then I know you just closed the tab you had focused, and I should undo the focus change Opera made and switch it to the tab you want focused instead.

My best guess is that one of two things is happening here:

  1. On your PC, the extension gets notified that a tab was closed before Opera focuses the tab it wants to focus next.
  2. On your PC, it takes a little longer than 100 milliseconds between the tab focused and tab closed events, so the extension doesn't think Opera recently focused a different tab.

joelspadin avatar Mar 19 '19 15:03 joelspadin

I understand, thanks.

I tested it for another clean install now /Windows 10 Pro 64 bit (CZ), mobile workstation DELL Precision 5530 (Intel Core i7-8850H @ Six Core 2.60GHz, 4.30GHz Turbo, 9MB 45W), 16 GB RAM/. The same problem.

zdenekvecera avatar Mar 19 '19 16:03 zdenekvecera

Here's a new version with settings to adjust timing and log events: https://github.com/ChaosinaCan/ClassicTabs/releases/tag/v2.0.0-beta.1

Please try increasing the "Tab close wait time" setting. If that doesn't fix the problem, check the "Enable logging" setting and reproduce the problem. Return to the extension's settings page, click the "Copy to clipboard" button under the log, and paste the log here.

joelspadin avatar Mar 24 '19 04:03 joelspadin

Thanks! I increased the value of "Tab close wait time" to 500, but it didn't help.

I have set "Open all tabs at the end" and "Focus the last-active tab".

500 is set, here's the log:

[4731] Tab created: id = 45, window = 13, opener = 14
[4731] moving tab 45 to end
[6459] Tab created: id = 46, window = 13, opener = 14
[6459] moving tab 46 to end
[8030] Tab created: id = 47, window = 13, opener = 14
[8030] moving tab 47 to end
[9323] Tab created: id = 48, window = 13, opener = 14
[9323] moving tab 48 to end
[16672] Tab activated: id = 45, window = 13
[18201] Tab activated: id = 46, window = 13
[19874] Tab activated: id = 48, window = 13
[22426] Tab removed: id = 48, window = 13, is closing? false
[22426] activeChanged = false, wasActive = false
[22427] Tab activated: id = 47, window = 13
[23877] Tab activated: id = 14, window = 13

Description:

Open tab 1 (it opens at the end)
Open tab 2 (it opens at the end)
Open tab 3 (it opens at the end)
Open tab 4 (it opens at the end)
Click on tab 1
Click on tab 2
Click on tab 4
Close tab 4
It moves me to the tab 3

zdenekvecera avatar Mar 24 '19 07:03 zdenekvecera

Looks like it was my guess no. 1 from earlier. On my PC, it would have activated tab 47 before removing tab 48. I'll try to make it handle both orders.

joelspadin avatar Mar 24 '19 21:03 joelspadin

Try this version: https://github.com/ChaosinaCan/ClassicTabs/releases/tag/v2.0.0-beta.2

This makes an attempt to handle either order in which Opera can send the close and focus events. I suspect I'll need to make additional changes to wait for Opera to focus the new tab, then undo it and focus the correct tab instead, but I want to see if this works first before I make those changes.

joelspadin avatar Mar 31 '19 20:03 joelspadin

Wow! This is absolutely amazing. It works! :) Thank you so much! :)

zdenekvecera avatar Mar 31 '19 20:03 zdenekvecera

Great! I'll try to update the version on addons.opera.com soon.

joelspadin avatar Mar 31 '19 21:03 joelspadin

Tested the Beta 2 and works for me as well, thanks so much!

arturo182 avatar Apr 02 '19 15:04 arturo182

Great! I'm working through the submission process now.

joelspadin avatar Apr 02 '19 16:04 joelspadin

Beta 2 works for me too as expected! Good old behavior! Many thanks!

PavelKucherenko avatar Apr 05 '19 20:04 PavelKucherenko

only works before rebooting. After rebooting, the extension in Opera is missing. It is necessary to install it each time i started Opera. Used beta 3.0

bullion85 avatar Apr 23 '19 13:04 bullion85

I don't know why that would be happening. Maybe some sort of security feature in Opera that makes extensions installed by drag and drop temporary?

Try going into the extensions page and turning on Developer Mode. If that doesn't work, then unzip the extension somewhere, click "Load unpacked extension", and find the folder you unzipped the extension to.

joelspadin avatar Apr 25 '19 01:04 joelspadin

Thank you very much! It works now. The problem was that I use RAMDisk. It is used as a temporary folder for unpacked files. After a reboot, the files are erased. Unzip and "Load unpacked extension" helped! Thx. again! Best extension.

bullion85 avatar Apr 28 '19 10:04 bullion85

The version from addons.opera.com still does not work as intended (opens rightmost tab instead of last active). And the latest beta from this thread can't be installed by drag and dropping (displaying "download complete" instead).

Do you think you could upload the fixed version to the opera addons page?

mporubov-eagleinvsys avatar Oct 01 '19 14:10 mporubov-eagleinvsys

I already have. Twice.

I haven't heard anything back from Opera about the updates I submitted, so I don't know why they won't publish it.

joelspadin avatar Oct 01 '19 17:10 joelspadin

Oh hey. Opera finally published version 2.0 more than a year after I submitted it!

I've since switched to using Edge as my main browser though, so I probably won't continue to update ClassicTabs.

joelspadin avatar Apr 23 '20 17:04 joelspadin

Thanks for your extension! I'm switched to Vivaldi - bugs with h264 after every update of Opera tired.

Oswalt-Gottfried avatar Apr 24 '20 16:04 Oswalt-Gottfried