Activate Tab On Hover
-
@barbudo2005 And sorry, but I don’t wanna mess with a third party extension, maybe someone else takes a look at it. This is off‐topic anyway, so you might wanna create a separate topic for it in https://forum.vivaldi.net/category/51/extensions (not a modification).
-
@luetage Thank you anyway. I understand.
-
Update for tab stacks:
// Activate Tab On Hover // https://forum.vivaldi.net/topic/50354/create-a-new-mod-mouseover-tab-select/4 // Activates tab on hover. { function activateTab(e, tab) { if (!tab.parentNode.classList.contains('active') && !e.shiftKey && !e.ctrlKey) { tab.addEventListener('mouseleave', function () { clearTimeout(wait); tab.removeEventListener('mouseleave', tab); }) wait = setTimeout(function () { if (tab.parentNode.parentNode.classList.contains('is-substack')) { const down = document.createEvent('MouseEvents'); down.initEvent('mousedown', true, true); tab.dispatchEvent(down); const up = document.createEvent('MouseEvents'); up.initEvent('mouseup',true,true); tab.dispatchEvent(up); } else { const id = Number(tab.parentNode.id.replace( /^\D+/g, '')); chrome.tabs.update(id, {active: true, highlighted: true}); } }, delay) } } var wait; const delay = 300; //pick a time in milliseconds var appendChild = Element.prototype.appendChild; Element.prototype.appendChild = function () { if (arguments[0].tagName === 'DIV' && arguments[0].classList.contains('tab-header')) { setTimeout(function () { var trigger = (event) => activateTab(event, arguments[0]); arguments[0].addEventListener('mouseenter', trigger); }.bind(this, arguments[0])); } return appendChild.apply(this, arguments); } }
Ugly but necessary. The parent tab of two level tab stacks doesn’t have a proper number id, but a string with mixed characters, which makes the chrome.tabs method fail. Simulating click still works for this. This was brought to my attention by N3C2L on github, don’t know whether they have an account here.
Anyway, I would have liked updating my original solution here, but admins have disabled editing posts again…
-
@luetage I was going to ask you to update the Mod for tab stacks, and realize you already did it. Bravo!!!!
-
@luetage
In snapshot 2352.3 / 2355.3,
Hover does not work on stacked tabs. -
Same problem. Not working on all three variants of stacked tabs. Perhaps a simulated click on the open and close arrow is the cure. I am afraid I am not capable of coding this.
Brian -
@shifte Sorry, never noticed the message
@brianhuahin Well, the latest version fixes it for second row stacked tabs, as there were no accordion stacks back then… -
Apologies. Agreed. I forgot to test on the two row setup.
-
@brianhuahin Broke for 2 level stacks too, this must have happened after some update. The mod recognises the stack but the simulated click fails now.
-
Ok, don’t know how to fix this. The problem is the collector tab doesn’t have a tab-id compatible with the chromium api to activate it. Triggering a simple
.click()
sadly doesn’t work either in the tabbar, therefore I used to simulate mouse events. This broke now. When the workaround of the workaround fails to do its job it gets frustrating. Maybe someone else has an idea, but I’m giving up for the time being. Activating normal tabs and tabs in an expanded stack still works as expected. -
@luetage
Thank you for your effort.
(୨୧•͈ᴗ•͈)◞ᵗʱᵃᵑᵏઽ*♡
Mod works nomal tab and second row tab even now.
So it's OK. ( ^-^)b -
It is not working in 4.3.2439.44.
Could you update it please? -
@luetage
Dear.
Is it possible to send click events on tabstack-thumbnails? instead of stacked tab. -
Sorry, it is working.
-
@shifte I’m afraid not, as far as I am aware it’s broken for the whole tab bar if not the whole UI.
-
@luetage
I understood, thank you. (´・ω・`) -
@luetage
I came up with a sloppy workaround.https://forum.vivaldi.net/topic/64835/autohotkey-recipes-for-vivaldi/26#
-
@shifte Great, can’t test but I’m sure it will help some folks on Windows.
-
@luetage
Is working again in 5.1.2567.49 Stable? (only for tabs not tab stack) -
@barbudo2005 It always worked for tabs, but tab stacks have the issue described above.