Documentation (API v1.0)
Browser context
Browser context APIs are used to get the browser page information. Currently, the location, selection and title of the document are available through the APIs.
Get Location
Sample:
RoamAbout.getLocation(callback, context, max_length)Samples
Request Parameters:
| Name | Optional/Required | Description |
| callback | Required | The function to call after processing the request with the status and result data. |
| context | Optional | The context text to pass for your reference. |
| max_length | Required | To set the maximum length for the location URL. It will truncate the location URL text to this max length. The default max length is 128. |
Callback function parameters:
| Name | Description |
| status | The status of the action performed, It would be 0 for successful response. |
| data | The response text to the callback function. For this API it will contain location URL in the data field. |
| context | The context parameter that you passed in the request. |
Get Selection
Sample:
RoamAbout.getSelection(callback, context, max_length)Samples
Request Parameters:
| Name | Optional/Required | Description |
| callback | Required | The function to call after processing the request with the status and result data. |
| context | Optional | The context text to pass for your reference. |
| max_length | Required | To set the maximum length for the selected text. It will truncate the selected content text to this max length. The default max length is 40. |
Callback function parameters:
| Name | Description |
| status | The status of the action performed, It would be 0 for successful response. |
| data | The response text to the callback function. For this API it will contain selected text in the data field. |
| context | The context parameter that you passed in the request. |
Get Title
Sample:
RoamAbout.getTitle(callback, context, max_length)Samples
Request Parameters:
| Name | Optional/Required | Description |
| callback | Required | The function to call after processing the request with the status and result data. |
| context | Optional | The context text to pass for your reference. |
| max_length | Required | To set the maximum length for the title. It will truncate the title text to this max length. The default max length is 40. |
Callback function parameters:
| Name | Description |
| status | The status of the action performed, It would be 0 for successful response. |
| data | The response text to the callback function. For this API it will contain title in the data field. |
| context | The context parameter that you passed in the request. |


