Gets the current browser window, passing its details into a callback.
The "current" window is not necessarily the same as the currently focused window. If this function is called from a background script, then it returns the currently focused window. But if it is called from a script whose document is associated with a particular browser window, then it returns that browser window. For example, if the browser is displaying a sidebar, then every browser window has its own instance of the sidebar document. If a script running in the sidebar document calls getCurrent()
, then it will return that sidebar document's window.
This is an asynchronous function that returns a Promise
.