Alternative way to highlight the current active page

This post is very much similar to the post of Abhijit. [Highlight the active page (Highight the active page)][1] by Abhijit. This would work very well if we have simpler routes, if we have complex routes(Modular routes) in our app where we have similar urls with same action then we need to enhance this approach. For e.g There are three links on the same page as follows. 'web/dashboard' 'mweb/dashboard' 'mapp/dashboard' All these are pointing to same action. i.e Dashboard. So selecting active tab based on action name will fail here and will highlight