extension.getViews()

Returns an array of the Window objects for each of the pages running inside the current extension.

Syntax

browser.extension.getViews(
  fetchProperties // optional object
)

Parameters

fetchPropertiesOptional
object.
typeOptional
extension.ViewType. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'.
windowIdOptional
integer. The window to restrict the search to. If omitted, returns all views.

Return value

array of object. Array of Window objects.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic support48.0

Examples

Acknowledgements

This API is based on Chromium's chrome.extension API. This documentation is derived from extension.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,