enum PseudoId in RenderStyleConstants.h).
*/
- export type PseudoId = "first-line"|"first-letter"|"grammar-error"|"highlight"|"marker"|"before"|"after"|"selection"|"backdrop"|"spelling-error"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new"|"-webkit-scrollbar"|"-webkit-resizer"|"-webkit-scrollbar-thumb"|"-webkit-scrollbar-button"|"-webkit-scrollbar-track"|"-webkit-scrollbar-track-piece"|"-webkit-scrollbar-corner";
+ export type PseudoId = "first-line"|"first-letter"|"grammar-error"|"highlight"|"marker"|"before"|"after"|"selection"|"backdrop"|"spelling-error"|"target-text"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new"|"-webkit-scrollbar"|"-webkit-resizer"|"-webkit-scrollbar-thumb"|"-webkit-scrollbar-button"|"-webkit-scrollbar-track"|"-webkit-scrollbar-track-piece"|"-webkit-scrollbar-corner";
/**
* Pseudo-style identifier (see enum PseudoId in RenderStyleConstants.h).
*/
diff --git a/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts b/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts
index a450127789..93367726ed 100644
--- a/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts
+++ b/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts
@@ -141,7 +141,7 @@ export class WKRouteImpl implements network.RouteDelegate {
});
}
- async continue(request: network.Request, overrides: types.NormalizedContinueOverrides) {
+ async continue(overrides: types.NormalizedContinueOverrides) {
// In certain cases, protocol will return error if the request was already canceled
// or the page was closed. We should tolerate these errors.
await this._session.sendMayFail('Network.interceptWithRequest', {
diff --git a/packages/playwright-core/src/utils/expectUtils.ts b/packages/playwright-core/src/utils/expectUtils.ts
new file mode 100644
index 0000000000..0ae21e8602
--- /dev/null
+++ b/packages/playwright-core/src/utils/expectUtils.ts
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { ExpectedTextValue } from '@protocol/channels';
+import { isRegExp, isString } from './rtti';
+
+export function serializeExpectedTextValues(items: (string | RegExp)[], options: { matchSubstring?: boolean, normalizeWhiteSpace?: boolean, ignoreCase?: boolean } = {}): ExpectedTextValue[] {
+ return items.map(i => ({
+ string: isString(i) ? i : undefined,
+ regexSource: isRegExp(i) ? i.source : undefined,
+ regexFlags: isRegExp(i) ? i.flags : undefined,
+ matchSubstring: options.matchSubstring,
+ ignoreCase: options.ignoreCase,
+ normalizeWhiteSpace: options.normalizeWhiteSpace,
+ }));
+}
diff --git a/packages/playwright-core/src/utils/index.ts b/packages/playwright-core/src/utils/index.ts
index 372922ec59..0bc7a75b08 100644
--- a/packages/playwright-core/src/utils/index.ts
+++ b/packages/playwright-core/src/utils/index.ts
@@ -21,6 +21,7 @@ export * from './debug';
export * from './debugLogger';
export * from './env';
export * from './eventsHelper';
+export * from './expectUtils';
export * from './fileUtils';
export * from './headers';
export * from './hostPlatform';
diff --git a/packages/playwright-core/src/utilsBundle.ts b/packages/playwright-core/src/utilsBundle.ts
index bb037a1ca7..a2a62be867 100644
--- a/packages/playwright-core/src/utilsBundle.ts
+++ b/packages/playwright-core/src/utilsBundle.ts
@@ -19,6 +19,7 @@ import path from 'path';
export const colors: typeof import('../bundles/utils/node_modules/colors/safe') = require('./utilsBundleImpl').colors;
export const debug: typeof import('../bundles/utils/node_modules/@types/debug') = require('./utilsBundleImpl').debug;
+export const dotenv: typeof import('../bundles/utils/node_modules/dotenv') = require('./utilsBundleImpl').dotenv;
export const getProxyForUrl: typeof import('../bundles/utils/node_modules/@types/proxy-from-env').getProxyForUrl = require('./utilsBundleImpl').getProxyForUrl;
export const HttpsProxyAgent: typeof import('../bundles/utils/node_modules/https-proxy-agent').HttpsProxyAgent = require('./utilsBundleImpl').HttpsProxyAgent;
export const jpegjs: typeof import('../bundles/utils/node_modules/jpeg-js') = require('./utilsBundleImpl').jpegjs;
diff --git a/packages/playwright-core/types/protocol.d.ts b/packages/playwright-core/types/protocol.d.ts
index 99ce1d3a6a..caadb2a577 100644
--- a/packages/playwright-core/types/protocol.d.ts
+++ b/packages/playwright-core/types/protocol.d.ts
@@ -1131,17 +1131,21 @@ using Audits.issueAdded event.
}
/**
- * Defines commands and events for browser extensions. Available if the client
-is connected using the --remote-debugging-pipe flag and
-the --enable-unsafe-extension-debugging flag is set.
+ * Defines commands and events for browser extensions.
*/
export module Extensions {
+ /**
+ * Storage areas.
+ */
+ export type StorageArea = "session"|"local"|"sync"|"managed";
/**
* Installs an unpacked extension from the filesystem similar to
--load-extension CLI flags. Returns extension ID once the extension
-has been installed.
+has been installed. Available if the client is connected using the
+--remote-debugging-pipe flag and the --enable-unsafe-extension-debugging
+flag is set.
*/
export type loadUnpackedParameters = {
/**
@@ -1155,6 +1159,81 @@ has been installed.
*/
id: string;
}
+ /**
+ * Gets data from extension storage in the given `storageArea`. If `keys` is
+specified, these are used to filter the result.
+ */
+ export type getStorageItemsParameters = {
+ /**
+ * ID of extension.
+ */
+ id: string;
+ /**
+ * StorageArea to retrieve data from.
+ */
+ storageArea: StorageArea;
+ /**
+ * Keys to retrieve.
+ */
+ keys?: string[];
+ }
+ export type getStorageItemsReturnValue = {
+ data: { [key: string]: string };
+ }
+ /**
+ * Removes `keys` from extension storage in the given `storageArea`.
+ */
+ export type removeStorageItemsParameters = {
+ /**
+ * ID of extension.
+ */
+ id: string;
+ /**
+ * StorageArea to remove data from.
+ */
+ storageArea: StorageArea;
+ /**
+ * Keys to remove.
+ */
+ keys: string[];
+ }
+ export type removeStorageItemsReturnValue = {
+ }
+ /**
+ * Clears extension storage in the given `storageArea`.
+ */
+ export type clearStorageItemsParameters = {
+ /**
+ * ID of extension.
+ */
+ id: string;
+ /**
+ * StorageArea to remove data from.
+ */
+ storageArea: StorageArea;
+ }
+ export type clearStorageItemsReturnValue = {
+ }
+ /**
+ * Sets `values` in extension storage in the given `storageArea`. The provided `values`
+will be merged with existing values in the storage area.
+ */
+ export type setStorageItemsParameters = {
+ /**
+ * ID of extension.
+ */
+ id: string;
+ /**
+ * StorageArea to set data in.
+ */
+ storageArea: StorageArea;
+ /**
+ * Values to set.
+ */
+ values: { [key: string]: string };
+ }
+ export type setStorageItemsReturnValue = {
+ }
}
/**
@@ -2532,16 +2611,6 @@ stylesheet rules) this rule came from.
*/
style: CSSStyle;
}
- /**
- * CSS position-fallback rule representation.
- */
- export interface CSSPositionFallbackRule {
- name: Value;
- /**
- * List of keyframes.
- */
- tryRules: CSSTryRule[];
- }
/**
* CSS @position-try rule representation.
*/
@@ -2888,10 +2957,6 @@ attributes) for a DOM node identified by `nodeId`.
* A list of CSS keyframed animations matching this node.
*/
cssKeyframesRules?: CSSKeyframesRule[];
- /**
- * A list of CSS position fallbacks matching this node.
- */
- cssPositionFallbackRules?: CSSPositionFallbackRule[];
/**
* A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
*/
@@ -3496,7 +3561,7 @@ front-end.
/**
* Pseudo element type.
*/
- export type PseudoType = "first-line"|"first-letter"|"before"|"after"|"marker"|"backdrop"|"selection"|"search-text"|"target-text"|"spelling-error"|"grammar-error"|"highlight"|"first-line-inherited"|"scroll-marker"|"scroll-marker-group"|"scrollbar"|"scrollbar-thumb"|"scrollbar-button"|"scrollbar-track"|"scrollbar-track-piece"|"scrollbar-corner"|"resizer"|"input-list-button"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new";
+ export type PseudoType = "first-line"|"first-letter"|"before"|"after"|"marker"|"backdrop"|"selection"|"search-text"|"target-text"|"spelling-error"|"grammar-error"|"highlight"|"first-line-inherited"|"scroll-marker"|"scroll-marker-group"|"scroll-next-button"|"scroll-prev-button"|"scrollbar"|"scrollbar-thumb"|"scrollbar-button"|"scrollbar-track"|"scrollbar-track-piece"|"scrollbar-corner"|"resizer"|"input-list-button"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new";
/**
* Shadow root type.
*/
@@ -3646,6 +3711,13 @@ The property is always undefined now.
compatibilityMode?: CompatibilityMode;
assignedSlot?: BackendNode;
}
+ /**
+ * A structure to hold the top-level node of a detached tree and an array of its retained descendants.
+ */
+ export interface DetachedElementInfo {
+ treeNode: Node;
+ retainedNodeIds: NodeId[];
+ }
/**
* A structure holding an RGBA color.
*/
@@ -4693,6 +4765,17 @@ File wrapper.
export type getFileInfoReturnValue = {
path: string;
}
+ /**
+ * Returns list of detached nodes
+ */
+ export type getDetachedDomNodesParameters = {
+ }
+ export type getDetachedDomNodesReturnValue = {
+ /**
+ * The list of detached nodes
+ */
+ detachedNodes: DetachedElementInfo[];
+ }
/**
* Enables console to refer to the node with given id via $x (see Command Line API for more details
$x functions).
@@ -11369,7 +11452,7 @@ as an ad.
* All Permissions Policy features. This enum should match the one defined
in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.
*/
- export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"bluetooth"|"browsing-topics"|"camera"|"captured-surface-control"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-prefers-color-scheme"|"ch-prefers-reduced-motion"|"ch-prefers-reduced-transparency"|"ch-rtt"|"ch-save-data"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-form-factors"|"ch-ua-full-version"|"ch-ua-full-version-list"|"ch-ua-platform-version"|"ch-ua-wow64"|"ch-viewport-height"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"compute-pressure"|"cross-origin-isolated"|"deferred-fetch"|"digital-credentials-get"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"identity-credentials-get"|"idle-detection"|"interest-cohort"|"join-ad-interest-group"|"keyboard-map"|"local-fonts"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"private-aggregation"|"private-state-token-issuance"|"private-state-token-redemption"|"publickey-credentials-create"|"publickey-credentials-get"|"run-ad-auction"|"screen-wake-lock"|"serial"|"shared-autofill"|"shared-storage"|"shared-storage-select-url"|"smart-card"|"speaker-selection"|"storage-access"|"sub-apps"|"sync-xhr"|"unload"|"usb"|"usb-unrestricted"|"vertical-scroll"|"web-printing"|"web-share"|"window-management"|"xr-spatial-tracking";
+ export type PermissionsPolicyFeature = "accelerometer"|"all-screens-capture"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"bluetooth"|"browsing-topics"|"camera"|"captured-surface-control"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-prefers-color-scheme"|"ch-prefers-reduced-motion"|"ch-prefers-reduced-transparency"|"ch-rtt"|"ch-save-data"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-form-factors"|"ch-ua-full-version"|"ch-ua-full-version-list"|"ch-ua-platform-version"|"ch-ua-wow64"|"ch-viewport-height"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"compute-pressure"|"cross-origin-isolated"|"deferred-fetch"|"digital-credentials-get"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"identity-credentials-get"|"idle-detection"|"interest-cohort"|"join-ad-interest-group"|"keyboard-map"|"local-fonts"|"magnetometer"|"media-playback-while-not-visible"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"private-aggregation"|"private-state-token-issuance"|"private-state-token-redemption"|"publickey-credentials-create"|"publickey-credentials-get"|"run-ad-auction"|"screen-wake-lock"|"serial"|"shared-autofill"|"shared-storage"|"shared-storage-select-url"|"smart-card"|"speaker-selection"|"storage-access"|"sub-apps"|"sync-xhr"|"unload"|"usb"|"usb-unrestricted"|"vertical-scroll"|"web-printing"|"web-share"|"window-management"|"xr-spatial-tracking";
/**
* Reason for a permissions policy feature to be disabled.
*/
@@ -11784,7 +11867,7 @@ Example URLs: http://www.google.com/file.html -> "google.com"
*/
fixed?: number;
}
- export type ClientNavigationReason = "formSubmissionGet"|"formSubmissionPost"|"httpHeaderRefresh"|"scriptInitiated"|"metaTagRefresh"|"pageBlockInterstitial"|"reload"|"anchorClick";
+ export type ClientNavigationReason = "anchorClick"|"formSubmissionGet"|"formSubmissionPost"|"httpHeaderRefresh"|"initialFrameNavigation"|"metaTagRefresh"|"other"|"pageBlockInterstitial"|"reload"|"scriptInitiated";
export type ClientNavigationDisposition = "currentTab"|"newTab"|"newWindow"|"download";
export interface InstallabilityErrorArgument {
/**
@@ -12298,6 +12381,10 @@ when bfcache navigation fails.
* Frame's new url.
*/
url: string;
+ /**
+ * Navigation type
+ */
+ navigationType: "fragment"|"historyApi"|"other";
}
/**
* Compressed image data requested by the `startScreencast`.
@@ -16922,7 +17009,7 @@ possible for multiple rule sets and links to trigger a single attempt.
/**
* List of FinalStatus reasons for Prerender2.
*/
- export type PrerenderFinalStatus = "Activated"|"Destroyed"|"LowEndDevice"|"InvalidSchemeRedirect"|"InvalidSchemeNavigation"|"NavigationRequestBlockedByCsp"|"MainFrameNavigation"|"MojoBinderPolicy"|"RendererProcessCrashed"|"RendererProcessKilled"|"Download"|"TriggerDestroyed"|"NavigationNotCommitted"|"NavigationBadHttpStatus"|"ClientCertRequested"|"NavigationRequestNetworkError"|"CancelAllHostsForTesting"|"DidFailLoad"|"Stop"|"SslCertificateError"|"LoginAuthRequested"|"UaChangeRequiresReload"|"BlockedByClient"|"AudioOutputDeviceRequested"|"MixedContent"|"TriggerBackgrounded"|"MemoryLimitExceeded"|"DataSaverEnabled"|"TriggerUrlHasEffectiveUrl"|"ActivatedBeforeStarted"|"InactivePageRestriction"|"StartFailed"|"TimeoutBackgrounded"|"CrossSiteRedirectInInitialNavigation"|"CrossSiteNavigationInInitialNavigation"|"SameSiteCrossOriginRedirectNotOptInInInitialNavigation"|"SameSiteCrossOriginNavigationNotOptInInInitialNavigation"|"ActivationNavigationParameterMismatch"|"ActivatedInBackground"|"EmbedderHostDisallowed"|"ActivationNavigationDestroyedBeforeSuccess"|"TabClosedByUserGesture"|"TabClosedWithoutUserGesture"|"PrimaryMainFrameRendererProcessCrashed"|"PrimaryMainFrameRendererProcessKilled"|"ActivationFramePolicyNotCompatible"|"PreloadingDisabled"|"BatterySaverEnabled"|"ActivatedDuringMainFrameNavigation"|"PreloadingUnsupportedByWebContents"|"CrossSiteRedirectInMainFrameNavigation"|"CrossSiteNavigationInMainFrameNavigation"|"SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"|"SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"|"MemoryPressureOnTrigger"|"MemoryPressureAfterTriggered"|"PrerenderingDisabledByDevTools"|"SpeculationRuleRemoved"|"ActivatedWithAuxiliaryBrowsingContexts"|"MaxNumOfRunningEagerPrerendersExceeded"|"MaxNumOfRunningNonEagerPrerendersExceeded"|"MaxNumOfRunningEmbedderPrerendersExceeded"|"PrerenderingUrlHasEffectiveUrl"|"RedirectedPrerenderingUrlHasEffectiveUrl"|"ActivationUrlHasEffectiveUrl"|"JavaScriptInterfaceAdded"|"JavaScriptInterfaceRemoved"|"AllPrerenderingCanceled"|"WindowClosed";
+ export type PrerenderFinalStatus = "Activated"|"Destroyed"|"LowEndDevice"|"InvalidSchemeRedirect"|"InvalidSchemeNavigation"|"NavigationRequestBlockedByCsp"|"MainFrameNavigation"|"MojoBinderPolicy"|"RendererProcessCrashed"|"RendererProcessKilled"|"Download"|"TriggerDestroyed"|"NavigationNotCommitted"|"NavigationBadHttpStatus"|"ClientCertRequested"|"NavigationRequestNetworkError"|"CancelAllHostsForTesting"|"DidFailLoad"|"Stop"|"SslCertificateError"|"LoginAuthRequested"|"UaChangeRequiresReload"|"BlockedByClient"|"AudioOutputDeviceRequested"|"MixedContent"|"TriggerBackgrounded"|"MemoryLimitExceeded"|"DataSaverEnabled"|"TriggerUrlHasEffectiveUrl"|"ActivatedBeforeStarted"|"InactivePageRestriction"|"StartFailed"|"TimeoutBackgrounded"|"CrossSiteRedirectInInitialNavigation"|"CrossSiteNavigationInInitialNavigation"|"SameSiteCrossOriginRedirectNotOptInInInitialNavigation"|"SameSiteCrossOriginNavigationNotOptInInInitialNavigation"|"ActivationNavigationParameterMismatch"|"ActivatedInBackground"|"EmbedderHostDisallowed"|"ActivationNavigationDestroyedBeforeSuccess"|"TabClosedByUserGesture"|"TabClosedWithoutUserGesture"|"PrimaryMainFrameRendererProcessCrashed"|"PrimaryMainFrameRendererProcessKilled"|"ActivationFramePolicyNotCompatible"|"PreloadingDisabled"|"BatterySaverEnabled"|"ActivatedDuringMainFrameNavigation"|"PreloadingUnsupportedByWebContents"|"CrossSiteRedirectInMainFrameNavigation"|"CrossSiteNavigationInMainFrameNavigation"|"SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"|"SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"|"MemoryPressureOnTrigger"|"MemoryPressureAfterTriggered"|"PrerenderingDisabledByDevTools"|"SpeculationRuleRemoved"|"ActivatedWithAuxiliaryBrowsingContexts"|"MaxNumOfRunningEagerPrerendersExceeded"|"MaxNumOfRunningNonEagerPrerendersExceeded"|"MaxNumOfRunningEmbedderPrerendersExceeded"|"PrerenderingUrlHasEffectiveUrl"|"RedirectedPrerenderingUrlHasEffectiveUrl"|"ActivationUrlHasEffectiveUrl"|"JavaScriptInterfaceAdded"|"JavaScriptInterfaceRemoved"|"AllPrerenderingCanceled"|"WindowClosed"|"SlowNetwork"|"OtherPrerenderedPageActivated";
/**
* Preloading status values, see also PreloadingTriggeringOutcome. This
status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
@@ -17270,6 +17357,101 @@ supported yet.
}
}
+ /**
+ * This domain allows configuring virtual Bluetooth devices to test
+the web-bluetooth API.
+ */
+ export module BluetoothEmulation {
+ /**
+ * Indicates the various states of Central.
+ */
+ export type CentralState = "absent"|"powered-off"|"powered-on";
+ /**
+ * Stores the manufacturer data
+ */
+ export interface ManufacturerData {
+ /**
+ * Company identifier
+https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml
+https://usb.org/developers
+ */
+ key: number;
+ /**
+ * Manufacturer-specific data
+ */
+ data: binary;
+ }
+ /**
+ * Stores the byte data of the advertisement packet sent by a Bluetooth device.
+ */
+ export interface ScanRecord {
+ name?: string;
+ uuids?: string[];
+ /**
+ * Stores the external appearance description of the device.
+ */
+ appearance?: number;
+ /**
+ * Stores the transmission power of a broadcasting device.
+ */
+ txPower?: number;
+ /**
+ * Key is the company identifier and the value is an array of bytes of
+manufacturer specific data.
+ */
+ manufacturerData?: ManufacturerData[];
+ }
+ /**
+ * Stores the advertisement packet information that is sent by a Bluetooth device.
+ */
+ export interface ScanEntry {
+ deviceAddress: string;
+ rssi: number;
+ scanRecord: ScanRecord;
+ }
+
+
+ /**
+ * Enable the BluetoothEmulation domain.
+ */
+ export type enableParameters = {
+ /**
+ * State of the simulated central.
+ */
+ state: CentralState;
+ }
+ export type enableReturnValue = {
+ }
+ /**
+ * Disable the BluetoothEmulation domain.
+ */
+ export type disableParameters = {
+ }
+ export type disableReturnValue = {
+ }
+ /**
+ * Simulates a peripheral with |address|, |name| and |knownServiceUuids|
+that has already been connected to the system.
+ */
+ export type simulatePreconnectedPeripheralParameters = {
+ address: string;
+ name: string;
+ manufacturerData: ManufacturerData[];
+ knownServiceUuids: string[];
+ }
+ export type simulatePreconnectedPeripheralReturnValue = {
+ }
+ /**
+ * Simulates an advertisement packet described in |entry| being received by
+the central.
+ */
+ export type simulateAdvertisementParameters = {
+ entry: ScanEntry;
+ }
+ export type simulateAdvertisementReturnValue = {
+ }
+ }
+
/**
* This domain is deprecated - use Runtime or Log instead.
*/
@@ -20122,6 +20304,10 @@ Error was thrown.
"Audits.checkContrast": Audits.checkContrastParameters;
"Audits.checkFormsIssues": Audits.checkFormsIssuesParameters;
"Extensions.loadUnpacked": Extensions.loadUnpackedParameters;
+ "Extensions.getStorageItems": Extensions.getStorageItemsParameters;
+ "Extensions.removeStorageItems": Extensions.removeStorageItemsParameters;
+ "Extensions.clearStorageItems": Extensions.clearStorageItemsParameters;
+ "Extensions.setStorageItems": Extensions.setStorageItemsParameters;
"Autofill.trigger": Autofill.triggerParameters;
"Autofill.setAddresses": Autofill.setAddressesParameters;
"Autofill.disable": Autofill.disableParameters;
@@ -20232,6 +20418,7 @@ Error was thrown.
"DOM.setNodeStackTracesEnabled": DOM.setNodeStackTracesEnabledParameters;
"DOM.getNodeStackTraces": DOM.getNodeStackTracesParameters;
"DOM.getFileInfo": DOM.getFileInfoParameters;
+ "DOM.getDetachedDomNodes": DOM.getDetachedDomNodesParameters;
"DOM.setInspectedNode": DOM.setInspectedNodeParameters;
"DOM.setNodeName": DOM.setNodeNameParameters;
"DOM.setNodeValue": DOM.setNodeValueParameters;
@@ -20616,6 +20803,10 @@ Error was thrown.
"PWA.launchFilesInApp": PWA.launchFilesInAppParameters;
"PWA.openCurrentPageInApp": PWA.openCurrentPageInAppParameters;
"PWA.changeAppUserSettings": PWA.changeAppUserSettingsParameters;
+ "BluetoothEmulation.enable": BluetoothEmulation.enableParameters;
+ "BluetoothEmulation.disable": BluetoothEmulation.disableParameters;
+ "BluetoothEmulation.simulatePreconnectedPeripheral": BluetoothEmulation.simulatePreconnectedPeripheralParameters;
+ "BluetoothEmulation.simulateAdvertisement": BluetoothEmulation.simulateAdvertisementParameters;
"Console.clearMessages": Console.clearMessagesParameters;
"Console.disable": Console.disableParameters;
"Console.enable": Console.enableParameters;
@@ -20722,6 +20913,10 @@ Error was thrown.
"Audits.checkContrast": Audits.checkContrastReturnValue;
"Audits.checkFormsIssues": Audits.checkFormsIssuesReturnValue;
"Extensions.loadUnpacked": Extensions.loadUnpackedReturnValue;
+ "Extensions.getStorageItems": Extensions.getStorageItemsReturnValue;
+ "Extensions.removeStorageItems": Extensions.removeStorageItemsReturnValue;
+ "Extensions.clearStorageItems": Extensions.clearStorageItemsReturnValue;
+ "Extensions.setStorageItems": Extensions.setStorageItemsReturnValue;
"Autofill.trigger": Autofill.triggerReturnValue;
"Autofill.setAddresses": Autofill.setAddressesReturnValue;
"Autofill.disable": Autofill.disableReturnValue;
@@ -20832,6 +21027,7 @@ Error was thrown.
"DOM.setNodeStackTracesEnabled": DOM.setNodeStackTracesEnabledReturnValue;
"DOM.getNodeStackTraces": DOM.getNodeStackTracesReturnValue;
"DOM.getFileInfo": DOM.getFileInfoReturnValue;
+ "DOM.getDetachedDomNodes": DOM.getDetachedDomNodesReturnValue;
"DOM.setInspectedNode": DOM.setInspectedNodeReturnValue;
"DOM.setNodeName": DOM.setNodeNameReturnValue;
"DOM.setNodeValue": DOM.setNodeValueReturnValue;
@@ -21216,6 +21412,10 @@ Error was thrown.
"PWA.launchFilesInApp": PWA.launchFilesInAppReturnValue;
"PWA.openCurrentPageInApp": PWA.openCurrentPageInAppReturnValue;
"PWA.changeAppUserSettings": PWA.changeAppUserSettingsReturnValue;
+ "BluetoothEmulation.enable": BluetoothEmulation.enableReturnValue;
+ "BluetoothEmulation.disable": BluetoothEmulation.disableReturnValue;
+ "BluetoothEmulation.simulatePreconnectedPeripheral": BluetoothEmulation.simulatePreconnectedPeripheralReturnValue;
+ "BluetoothEmulation.simulateAdvertisement": BluetoothEmulation.simulateAdvertisementReturnValue;
"Console.clearMessages": Console.clearMessagesReturnValue;
"Console.disable": Console.disableReturnValue;
"Console.enable": Console.enableReturnValue;
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 9c125fef1e..37281a1eb4 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -288,41 +288,8 @@ export interface Page {
* [browserContext.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-init-script)
* and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not
* defined.
- *
- * **Bundling**
- *
- * If you have a complex script split into several files, it needs to be bundled into a single file first. We
- * recommend running [`esbuild`](https://esbuild.github.io/) or [`webpack`](https://webpack.js.org/) to produce a
- * commonjs module and pass `path` and `arg`.
- *
- * ```js
- * // mocks/mockRandom.ts
- * // This script can import other files.
- * import { defaultValue } from './defaultValue';
- *
- * export default function(value?: number) {
- * window.Math.random = () => value ?? defaultValue;
- * }
- * ```
- *
- * ```js
- * // tests/example.spec.ts
- * const mockPath = { path: path.resolve(__dirname, '../mocks/mockRandom.js') };
- *
- * // Passing 42 as an argument to the default export function.
- * await page.addInitScript({ path: mockPath }, 42);
- *
- * // Make sure to pass something even if you do not need to pass an argument.
- * // This instructs Playwright to treat the file as a commonjs module.
- * await page.addInitScript({ path: mockPath }, '');
- * ```
- *
* @param script Script to be evaluated in the page.
- * @param arg Optional JSON-serializable argument to pass to `script`.
- * - When `script` is a function, the argument is passed to it directly.
- * - When `script` is a file path, the file is assumed to be a commonjs module. The default export, either
- * `module.exports` or `module.exports.default`, should be a function that's going to be executed with this
- * argument.
+ * @param arg Optional argument to pass to `script` (only supported when passing a function).
*/
addInitScript