Movatterモバイル変換


[0]ホーム

URL:


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

runtime.openOptionsPage()

If your extension has anoptions page defined, this method opens it.

This is an asynchronous function that returns aPromise.

Syntax

js
let openingPage = browser.runtime.openOptionsPage()

Parameters

None.

Return value

APromise that will be fulfilled with no arguments when the options page has been created successfully, or rejected with an error message if the operation failed.

Examples

Open the options page when the user clicks a browser action's icon:

js
function onOpened() {  console.log(`Options page opened`);}function onError(error) {  console.log(`Error: ${error}`);}let opening = browser.runtime.openOptionsPage();opening.then(onOpened, onError);

Example extensions

Browser compatibility

Note:This API is based on Chromium'schrome.runtime API. This documentation is derived fromruntime.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