Table of Contents

Class Extension

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

Represents an Extension instance installed in the browser.

public abstract class Extension
Inheritance
Extension

Remarks

This API is experimental.

Constructors

Extension(string, string, string, string, bool)

Initializes a new instance of the Extension class.

protected Extension(string id, string version, string name, string path, bool enabled)

Parameters

id string

The extension ID.

version string

The extension version.

name string

The extension name.

path string

The file system path of the extension.

enabled bool

Whether the extension is enabled.

Properties

Enabled

Gets a value indicating whether the extension is enabled.

public bool Enabled { get; }

Property Value

bool

Id

Gets the ID of the extension.

public string Id { get; }

Property Value

string

Name

Gets the name of the extension.

public string Name { get; }

Property Value

string

Path

Gets the path in the file system where the extension is located.

public string Path { get; }

Property Value

string

Version

Gets the version of the extension.

public string Version { get; }

Property Value

string

Methods

PagesAsync()

Returns the list of the visible pages of the extension.

public abstract Task<IReadOnlyList<IPage>> PagesAsync()

Returns

Task<IReadOnlyList<IPage>>

A task that resolves to the list of pages.

TriggerActionAsync(IPage)

Triggers an extension default action on the given page.

public abstract Task TriggerActionAsync(IPage page)

Parameters

page IPage

The page to trigger the action on.

Returns

Task

A task that completes when the action is triggered.

WorkersAsync()

Returns the list of the currently active service workers of the extension.

public abstract Task<IReadOnlyList<WebWorker>> WorkersAsync()

Returns

Task<IReadOnlyList<WebWorker>>

A task that resolves to the list of web workers.