• About the Connect JavaScript API
  • Confluence
  • Context
  • Cookie
  • Custom content
  • Dialog
  • Events
  • Flag
  • History
  • Host
  • Iframe
  • Inline dialog
  • Navigator
  • Request
  • Scroll position
  • User

Host

Hosts are the primary method for Connect apps to interact with the page.

Methods

getSelectedText (callback)

Gets the selected text on the page.

Parameters

NameTypeDescription
callbackfunction

Callback method to be executed with the selected text.

Example

1
2
3
AP.host.getSelectedText(function (selection) {
  console.log(selection);
});

  • System status
  • Privacy
  • Developer Terms
  • Trademark
  • Cookie Preferences
  • © 2019 Atlassian