puppeteer-core
Version:
A high-level API to control headless Chrome over the DevTools Protocol
88 lines • 1.91 kB
JavaScript
"use strict";
/**
* @license
* Copyright 2026 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Extension = void 0;
/**
* {@link Extension} represents a browser extension installed in the browser.
* It provides access to the extension's ID, name, and version, as well as
* methods for interacting with the extension's background workers and pages.
*
* @example
* To get all extensions installed in the browser:
*
* ```ts
* const extensions = await browser.extensions();
* for (const [id, extension] of extensions) {
* console.log(extension.name, id);
* }
* ```
*
* @experimental
* @public
*/
class Extension {
/**
* @internal
*/
constructor(id, version, name, path, enabled) {
if (!id || !version) {
throw new Error('Extension ID and version are required');
}
this.
this.
this.
this.
this.
}
/**
* Whether the extension is enabled.
*
* @public
*/
get enabled() {
return this.
}
/**
* The path in the file system where the extension is located.
*
* @public
*/
get path() {
return this.
}
/**
* The version of the extension as specified in its manifest.
*
* @public
*/
get version() {
return this.
}
/**
* The name of the extension as specified in its manifest.
*
* @public
*/
get name() {
return this.
}
/**
* The unique identifier of the extension.
*
* @public
*/
get id() {
return this.
}
}
exports.Extension = Extension;
//# sourceMappingURL=Extension.js.map