AP offers AP.getLocation(callback()) . However it seems this is not documented. Is that because this function is deprecated or not official?
@rwhitbeck No, the function AP.navigator.getLocation returns a json object with different information. AP.getLocation returns a string with the host Url of the atlassian.net location.
These functions are very similar called, but return different information.
@rwhitbeck
AP.navigator.getLocation returns:
{"target":"contentview","context":{"contentId":123456789,"contentType":"page","spaceKey":"TEST"}}
while AP.getLocation returns:
"https://XXXXX.atlassian.net/wiki/spaces/TEST/pages/123456789/PAGENAME"
I just hit this as well and I am confused why this is not documented (anymore?). @rwhitbeck there is a post here that refers to AP.getLocation
but like @marc mentioned this is different from AP.navigator.getLocation
.
This method is still documented for Bitbucket Cloud: AP
Indeed. It would be helpful to have it officially documented and supported.
I couldnât have AP.navigator.getLocation working, but AP.getLocation does it perfectly.
These 2 lines generate the output below:
=== code ===
AP.navigator.getLocation(function (url) { console.log(url) });
AP.getLocation(function (url) { console.log(url) });
=== console ===
no context function defined
getLocation @ batch.js?jag=true&locale=en-GB:7650
b._handleRequest @ batch.js?jag=true&locale=en-GB:7510
c._receiveMessage @ batch.js?jag=true&locale=en-GB:7523
batch.js?jag=true&locale=en-GB:1096 WARN: âtriggerPrivacyPolicySafeEventâ has been deprecated
https://synchronit.atlassian.net/plugins/servlet/ac/com.synchronit.glasnost/jira-glasnost?project.key=DEMO&project.id=10000
Happy to help if more details to solve this are needed.
The documentation was added back in December. I think this is where AP.getLocation
is documented Iframe