MDN self-hosted library · e01.org

extension.getViews()

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const windows = browser.extension.getViews();

for (const extensionWindow of windows) {
  console.log(extensionWindow.location.href);
}
js
const windows = browser.extension.getViews({ type: "tab" });
js
const windows = browser.extension.getViews({ type: "popup" });