Interface IExtensions
- Namespace
- Selenium.WebDriver.BiDi.Cdp.Extensions
- Assembly
- Selenium.WebDriver.BiDi.Cdp.dll
Defines commands and events for browser extensions.
[Experimental("BIDICDP001")]
public interface IExtensions
Methods
ClearStorageItemsAsync(string, StorageArea, string?, CancellationToken)
Clears extension storage in the given storageArea.
Task<ClearStorageItemsResult> ClearStorageItemsAsync(string id, StorageArea storageArea, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringID of extension.
storageAreaStorageAreaStorageArea to remove data from.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ClearStorageItemsResult>
A task representing the asynchronous operation, containing a ClearStorageItemsResult.
GetExtensionsAsync(string?, CancellationToken)
Gets a list of all unpacked extensions.
Task<GetExtensionsResult> GetExtensionsAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetExtensionsResult>
A task representing the asynchronous operation, containing a GetExtensionsResult.
GetStorageItemsAsync(string, StorageArea, ImmutableArray<string>?, string?, CancellationToken)
Gets data from extension storage in the given storageArea. If keys is specified, these are used to filter the result.
Task<GetStorageItemsResult> GetStorageItemsAsync(string id, StorageArea storageArea, ImmutableArray<string>? keys = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringID of extension.
storageAreaStorageAreaStorageArea to retrieve data from.
keysImmutableArray<string>?Keys to retrieve.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetStorageItemsResult>
A task representing the asynchronous operation, containing a GetStorageItemsResult.
LoadUnpackedAsync(string, bool?, string?, CancellationToken)
Installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed.
Task<LoadUnpackedResult> LoadUnpackedAsync(string path, bool? enableInIncognito = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
pathstringAbsolute file path.
enableInIncognitobool?Enable the extension in incognito
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<LoadUnpackedResult>
A task representing the asynchronous operation, containing a LoadUnpackedResult.
RemoveStorageItemsAsync(string, StorageArea, ImmutableArray<string>, string?, CancellationToken)
Removes keys from extension storage in the given storageArea.
Task<RemoveStorageItemsResult> RemoveStorageItemsAsync(string id, StorageArea storageArea, ImmutableArray<string> keys, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringID of extension.
storageAreaStorageAreaStorageArea to remove data from.
keysImmutableArray<string>Keys to remove.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<RemoveStorageItemsResult>
A task representing the asynchronous operation, containing a RemoveStorageItemsResult.
SetStorageItemsAsync(string, StorageArea, JsonElement, string?, CancellationToken)
Sets values in extension storage in the given storageArea. The provided values will be merged with existing values in the storage area.
Task<SetStorageItemsResult> SetStorageItemsAsync(string id, StorageArea storageArea, JsonElement values, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringID of extension.
storageAreaStorageAreaStorageArea to set data in.
valuesJsonElementValues to set.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetStorageItemsResult>
A task representing the asynchronous operation, containing a SetStorageItemsResult.
TriggerActionAsync(string, string, string?, CancellationToken)
Runs an extension default action.
Task<TriggerActionResult> TriggerActionAsync(string id, string targetId, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringExtension id.
targetIdstringA tab target ID to trigger the default extension action on.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<TriggerActionResult>
A task representing the asynchronous operation, containing a TriggerActionResult.
UninstallAsync(string, string?, CancellationToken)
Uninstalls an unpacked extension (others not supported) from the profile.
Task<UninstallResult> UninstallAsync(string id, string? session = null, CancellationToken cancellationToken = default)
Parameters
idstringExtension id.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<UninstallResult>
A task representing the asynchronous operation, containing a UninstallResult.