Movatterモバイル変換


[0]ホーム

URL:


  1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. browserAction
  6. browserAction.getPopup()

browserAction.getPopup()

Gets the HTML document set as the popup for this browser action.

This is an asynchronous function that returns aPromise.

Syntax

js
let gettingPopup = browser.browserAction.getPopup(  details               // object)

Parameters

details

An object with the following properties:

tabIdOptional

integer. The tab whose popup to get.

windowIdOptional

integer. The windows whose popup to get.

  • IfwindowId andtabId are both supplied, the function fails.
  • IfwindowId andtabId are both omitted, the global popup is returned.

Return value

APromise that will be fulfilled with a string containing the URL for the popup's document. This will be a fully qualified URL, such asmoz-extension://d1d8a2eb-fe60-f646-af30-a866c5b39942/popups/popup2.html.

Examples

Get the popup's URL:

js
function gotPopup(popupURL) {  console.log(popupURL);}let gettingPopup = browser.browserAction.getPopup({});gettingPopup.then(gotPopup);

Browser compatibility

Note:This API is based on Chromium'schrome.browserAction API. This documentation is derived frombrowser_action.json in the Chromium code.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp