How can I obtain the URL for a selected document in a sharepoint framework extension?
e.g. a friendly url or unique reference that a user can use to open the selected document;
https://mysite.sharepoint.com/sites/test/documents/mydocument.pdf
I'm trying to create a new item in the ECB menu 'Open in my application' that will get the url for selected document, insert a prefix, and pass the url to the browser;
protocol-handler://MyPrefixhttps://mysite.sharepoint.com/sites/test/documents/mydocument.pdf
I'm having difficulty obtaining the URL for the document using the sharepoint framework, I'm unsure if it's even possible. I've looked in the api reference for objects like sp-page-context but was unable to see any methods or properties that would return the URL for the selected document.
In the past this has been possible using Sharepoint Apps (e.g. {SiteUrl}{ItemUrl}), but I don't believe these are compatible with Sharepoint Online. What would be the correct approach to achieve this in Sharepoint Online?
Useful references;
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview https://docs.microsoft.com/en-us/javascript/api/overview/sharepoint