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
idstringThe extension ID.
versionstringThe extension version.
namestringThe extension name.
pathstringThe file system path of the extension.
enabledboolWhether the extension is enabled.
Properties
Enabled
Gets a value indicating whether the extension is enabled.
public bool Enabled { get; }
Property Value
Id
Gets the ID of the extension.
public string Id { get; }
Property Value
Name
Gets the name of the extension.
public string Name { get; }
Property Value
Path
Gets the path in the file system where the extension is located.
public string Path { get; }
Property Value
Version
Gets the version of the extension.
public string Version { get; }
Property Value
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
pageIPageThe 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.