Write a method that shows the selected tab of plone admin interface?

I had an issue that should register JS and CSS resources just at view tab at plone admin bar with collective.glossary product:

There I found that it is not that simple to know what is the selected tab because sometimes you configure a folder default view or other issues solved by this code

Also I saw some hacks at collective.cover to determine if we are at compose tab.

So I was complaining if we should write something at plone.api or portal_actions that return the current tab of plone admin interface (using the same rules of the code mentioned) ?

I'm not commenting about the rest, but this special case could be handled, at least, by rendering the JS / CSS resource link in a viewlet registered against IViewView view interface:

<browser:viewlet
    name="my_resource_viewlet"
    for="*"
    view="plone.app.layout.globals.interfaces.IViewView"
    manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
    template="..."
    permission="zope2.View"
    />

IViewView is a special interface, which is used to mark the default view of any content.

@rodfersou your post is neither Plone core nor Framework Team related. Please use Add-on Development for those kind of questions.