How to debug a aura component is running on community or a normal app

Using this code:
doInit: function(component, event, helper) {
        var context = (new RegExp('.*?\/s\/','g')).exec(window.location.href);
        var path=(new RegExp(':\/\/(.*\.com)\/([A-Za-z0-9]*\/)?s\/','g')).exec(window.location.href);
        context != null ? path[2] == undefined ? '' : path[2] : null;
        console.log('###',context);
}
Community Debug:

Non-Community Debug:

Thanks
Apex Coder

Comments

Popular posts from this blog

Lightning:input type date not displaying correctly

Navigate to a independent Aura component from Visualforce Page