In a Salesforce Community's knowledge article detail page, I am using window.location.pathname in lightning component controller to retrieve the page url (I want to later pass the url to the Apex controller to get the article url name). This is working in Salesforce classic but not in Lightning Experience. Is there any alternative?
I have read about pageReference and sforce.one navigation methods but I don't want to navigate, just to extract the url of the current community page.