Tree Tabs
-
When I have time I may think of some way to publish it to Chrome store. But I will have even more testing and maintenance for compatibility.
Thank you!
Reload by using reload button on the web panel toolbar usually does the job... So I'm not sure what's up
If you just turn off and back on the web panel it does not reload tree tabs. Which actually is really cool, since tree tabs shows up instantly.Ah, I didn' t interpret the 'home' button as reload. When I meant reload - I did 'Show desktop/mobile version' which is actually works fine it turns out if I do it for both windows.
In this case, may I suggest a hack of doing self-reload on (or a few moments after) browser startup? -
In this case, may I suggest a hack of doing self-reload on (or a few moments after) browser startup?
Sorry I didn't explain it better, issue is a bit more complex than simply reloading.
When I call chrome.windows.getCurrent or chrome.tabs.query({currentWindow: true}) for tabs, Vivaldi always returns activeWindow, so even if I reload all sidebars, all sidebars in non-active windows, will always get window (and tabs) from the active window.
No matter how many times i reload it from the sidebar, result will be the same.
Only when user manually reloads the sidebar (panel), in active window it will get correct tabs, simply because this window is automatically active.
I will have to do something else.
Anyway I found my conversation for exactly this issue in Opera, it got fixed 3 years ago And like I said, it must be in chrome itself.
https://forums.opera.com/topic/11488/sidebar-windowid/11EDIT:
I reported a bug to Vivaldi (VB-39922). So maybe they will take a look. Firefox does it right and also Opera, so why not Vivaldi? Why should we suffer because of this issue right?EDIT2:
Ok, I added a little check, on mouse press on empty space anywhere close to tabs. This way I know for 100% that this window is active and I can check if previously taken window is correct. If not, panel will auto reload. A little clunky, but this way you will have correct tabs, without the need to do it manually. Just click below tabs or on panel's scrollbar.
I will upload update soon. -
@stvad There must be something going on there... Maybe some tab with particular url from Firefox. But I can't tell what it could be. Also after I changed storage method there is no way to check, if it gets truncated or something. When I was using regular local storage It was possible to check all variables from extensions page->inspect background->in dev window->Application->Local Storage.
But permanent storage does not allow to take a look there. I can make something to "print out tabs ids and hashes" so you can run it and and tell me the results afterwards... Also you can turn on debug in options and restart vivaldi, after that you can go to extensions page and click on inspect background and tell me what console says there... -
@kroppy Ah I see. Is there a way to get tabs for all windows i.e {'windowId': [tab_list]} map and maybe then query current window id and pick only relevant tabs from that map (unless querying current window id have the same bug)?
Thanks for introducing a hack (would it work if I try to click on the tab and not nearby?)
-
@kroppy It's embarrassing but I didn't figure out a way to do the raw copy of the console output . Best I found is using copy function to copy any particular object to the clipboard, but there is a ton of them...
I'd go with the custom print script (or advice if you know how to do the raw dump of the console log) -
@stvad That's ok, I packed Nightly today, so can you check this one out?
https://drive.google.com/open?id=1jf-8QtsaFlVjvFFBaU3PYcN8C6R7VcJG -
Ah I see. Is there a way to get tabs for all windows i.e {'windowId': [tab_list]} map and maybe then query current window id and pick only relevant tabs from that map (unless querying current window id have the same bug)?
This is what chrome.tabs.query({currentWindow: true}) is for. And this is where the bug is
Even with just tabs query where I get all tabs, I have no way to get current window, until this window becomes active. Because any command to get current window returns, active, not current. I don't know how to explain this better... -
@kroppy I understand the issue. The previous suggestion was more of an attempt to distinguish between the situation 'chrome.tabs.query({currentWindow: true})' has a bug (in which case it would've been possible to work around by using other methods) vs all methods to get current window id have a bug.
-
@kroppy Thanks, I'll give it a try.
-
@stvad This version seems to be working alright so far :). Thank you!
-
@kroppy As we are talking here I have a few notes on/requests for groups:
-
A minimal request is for an active group to switch if you've switched the tab (i.e. with Cmd+Tab/Cmd1..8) and the new tab is in an inactive group, as the current situation is rather confusing.
-
Not sure how feasible is this one, as it'd likely require an override of standard shortcuts, but it'd be great if groups felt more like 'windows' w.r.t. tab switching (Cmd+1..8; Cmd+9; Cmd+PgUp/PgDown). What I mean by this is that if I'm withing some tab group and I press Cmd +1 (go to the first tab) I expect to end up with the first tab in the group active, but I end up on the first tab of the window, which can be invisible (due to 1) and so the overall experience is rather confusing (and I do it all the time ). The same goes for Cmd+9 (go to the last tab) and others.
Thanks!
-
-
@kroppy just experienced the same issue again :(. It may sound funny but I notice a correlation with 'proper' browser shutdown. I.e. previous 2 times when I happen to restart the browser were because it has crashed and in those cases, the TreeTabs have preserved its state just fine. But I just did proper browser shutdown and start - and got the recurrence of the problem as a result
-
- Oh gosh indeed, I have it fixed now. It will activate group on switch.
- Unfortunately reserved browser keys cannot be replaced Even by user. I think I discussed it here, if not here, maybe on GitLab. Also commented many times on Firefox addons page...
Ctrl or Cmd + number are blocked by all browsers. Also Ctrl+Tab, Ctrl+Shift+Tab. There are many others too.
-
rt the browser were because it has crashed and in those cases, the TreeTabs have preserved its state just fine. But I just did proper browser shutdown and start - and got the recurrence of the problem as a result
Whoooaaa this is weird!.... Can you do a tiny test? Can you exit Vivaldi from menu File->Exit? And start again to see if problem persists?
-
@kroppy did a proper shutdown (File -> exit) and got the issue reproduced again (though this time I didn't lose the groups, but all tabs ended up in 'ungrouped' and the tree structure was lost).
-
@stvad What worries me is that, if groups are there and tabs land in ungrouped, could mean that my extension can't recognize tabs for some reason. If groups are restored it means that "windows" array is properly saved, but not "tabs" array... Do you have any other extension running beside TreeTabs?
-
@kroppy 1) Yay!
2) Yeah, I figured that there may be something like that =.
My mind gave me here an approach that may not be practical, but probably at least interesting to entertain . What if we take the active group and even though we're displaying it where it is - move the underlying tabs to the position when the would've been if it were the first group (don't know how computationally expensive is it)? That would solve the Cmd1-8 thing. The last tab is complicated though - to get a consistent Cmd+9 behavior - you'd need to move it to the global last place, but then move it to its 'proper' position when it becomes active or something like that -
@kroppy As far as I remember groups were not saved last time =/. I'll let you know any other farther datapoints I'll have.
Yes, I do have a bunch of other extensions. Didn't notice data corruption issues with any of them so far. -
@stvad Interesting approach... Moving all tabs from the group would be impossible, browser can be totally unresponsive while moving them all at once, this is why I move them gradually after user moved tabs in the panel and if no other task is running. But if I can move first ten and last one it could be done. Problem is that we come back to ctrl+tab problem again. For example if I move 10 tabs to the front and if user goes to 11th, it will fail to stay in group. Obviously I can try to do that and see how heavy it is in reality. Problem would still persist with the last tab when pressing ctrl+shift+tab to go back, if there was any group in the middle.
I will try to figure something out. -
@stvad Data is not necessarily corrupted. It may be some extension that replaces tabs, session, urls, blocks javascript or something similar.
If you start vivaldi, and turn on debug mode in my extension, after start did it say in console something like "Attempt x failed, matched tabs was below 50%?
If so, maybe you should try disabling other extensions one by one, to see if problem persists? We could then find if any of those extensions is incompatible, and maybe I could find a workaround, by trying out that extension by myself.
It's really hard to guess, if I don't know much