Can there be some type of programmable tab functionality where, we set context menus on tabs. Example:
Let’s take a tab with the YouTube origin and YouTube implements the context menu when clicked on they add whatever functionality they want, like playing video, pausing video. Muting not needed since chrome already does that.
How would this work I’m not really sure, context menus in HTML are not even fully supported right now.
Anywho maybe it’ll be the same just the type would be tab
or something
<menu type="tab" id="tabMenus">
<menuitem label="Play">
<menuitem label="Pause">
</menu>
And the javascript would be something like:
tabMenus.addEventListener('click', function(e) {
var video = document.querySelector('video'); //Im sure youtube stores video element another way
(e.target.label == "Play") ? video.play() : video.pause();
});
So now if I’m browsing on one tab and YouTube video is playing on another, I don’t have to click on the tab and pause the video, now I can just right click and press pause. This is one example I’m sure more people can think of other examples.
Also chrome allows tab highlighting so what if I highlight multiple YouTube tabs and click pause then all of them pause. The context menus would only show up if the highlighted tabs share the same origin or path.
Please let me know if this has been discussed?
P.S I wasn’t sure what category this should be under but because it should be programmable I thought it’d be in API’s