diff --git a/CHANGELOG.md b/CHANGELOG.md index d517fdd6..43125bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.19.0 +- Update to Chromium 109 +- Adds a setter for the TargetInfo type + ## 2.18.0 - Expose `Worker` class - Update the default arguments used to launch the chromium process diff --git a/lib/protocol/browser.dart b/lib/protocol/browser.dart index fd6a5a3e..3e88ecc6 100644 --- a/lib/protocol/browser.dart +++ b/lib/protocol/browser.dart @@ -419,6 +419,8 @@ enum PermissionType { durableStorage('durableStorage'), flash('flash'), geolocation('geolocation'), + idleDetection('idleDetection'), + localFonts('localFonts'), midi('midi'), midiSysex('midiSysex'), nfc('nfc'), @@ -427,11 +429,12 @@ enum PermissionType { periodicBackgroundSync('periodicBackgroundSync'), protectedMediaIdentifier('protectedMediaIdentifier'), sensors('sensors'), + storageAccess('storageAccess'), videoCapture('videoCapture'), videoCapturePanTiltZoom('videoCapturePanTiltZoom'), - idleDetection('idleDetection'), wakeLockScreen('wakeLockScreen'), wakeLockSystem('wakeLockSystem'), + windowManagement('windowManagement'), ; final String value; @@ -450,7 +453,6 @@ enum PermissionType { enum PermissionSetting { granted('granted'), denied('denied'), - prompt('prompt'), ; final String value; diff --git a/lib/protocol/css.dart b/lib/protocol/css.dart index 1cc2a440..e24f9ef8 100644 --- a/lib/protocol/css.dart +++ b/lib/protocol/css.dart @@ -1375,8 +1375,19 @@ class CSSContainerQuery { /// Optional name for the container. final String? name; + /// Optional physical axes queried for the container. + final dom.PhysicalAxes? physicalAxes; + + /// Optional logical axes queried for the container. + final dom.LogicalAxes? logicalAxes; + CSSContainerQuery( - {required this.text, this.range, this.styleSheetId, this.name}); + {required this.text, + this.range, + this.styleSheetId, + this.name, + this.physicalAxes, + this.logicalAxes}); factory CSSContainerQuery.fromJson(Map json) { return CSSContainerQuery( @@ -1388,6 +1399,12 @@ class CSSContainerQuery { ? StyleSheetId.fromJson(json['styleSheetId'] as String) : null, name: json.containsKey('name') ? json['name'] as String : null, + physicalAxes: json.containsKey('physicalAxes') + ? dom.PhysicalAxes.fromJson(json['physicalAxes'] as String) + : null, + logicalAxes: json.containsKey('logicalAxes') + ? dom.LogicalAxes.fromJson(json['logicalAxes'] as String) + : null, ); } @@ -1397,6 +1414,8 @@ class CSSContainerQuery { if (range != null) 'range': range!.toJson(), if (styleSheetId != null) 'styleSheetId': styleSheetId!.toJson(), if (name != null) 'name': name, + if (physicalAxes != null) 'physicalAxes': physicalAxes!.toJson(), + if (logicalAxes != null) 'logicalAxes': logicalAxes!.toJson(), }; } } diff --git a/lib/protocol/debugger.dart b/lib/protocol/debugger.dart index f182038b..e296f06b 100644 --- a/lib/protocol/debugger.dart +++ b/lib/protocol/debugger.dart @@ -365,12 +365,12 @@ class DebuggerApi { }); } - /// Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or - /// no exceptions. Initial pause on exceptions state is `none`. + /// Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, + /// or caught exceptions, no exceptions. Initial pause on exceptions state is `none`. /// [state] Pause on exceptions mode. Future setPauseOnExceptions( - @Enum(['none', 'uncaught', 'all']) String state) async { - assert(const ['none', 'uncaught', 'all'].contains(state)); + @Enum(['none', 'caught', 'uncaught', 'all']) String state) async { + assert(const ['none', 'caught', 'uncaught', 'all'].contains(state)); await _client.send('Debugger.setPauseOnExceptions', { 'state': state, }); diff --git a/lib/protocol/dom.dart b/lib/protocol/dom.dart index 46010bf1..835303a0 100644 --- a/lib/protocol/dom.dart +++ b/lib/protocol/dom.dart @@ -685,15 +685,20 @@ class DOMApi { return GetFrameOwnerResult.fromJson(result); } - /// Returns the container of the given node based on container query conditions. - /// If containerName is given, it will find the nearest container with a matching name; - /// otherwise it will find the nearest container regardless of its container name. + /// Returns the query container of the given node based on container query + /// conditions: containerName, physical, and logical axes. If no axes are + /// provided, the style container is returned, which is the direct parent or the + /// closest element with a matching container-name. /// Returns: The container node for the given node, or null if not found. Future getContainerForNode(NodeId nodeId, - {String? containerName}) async { + {String? containerName, + PhysicalAxes? physicalAxes, + LogicalAxes? logicalAxes}) async { var result = await _client.send('DOM.getContainerForNode', { 'nodeId': nodeId, if (containerName != null) 'containerName': containerName, + if (physicalAxes != null) 'physicalAxes': physicalAxes, + if (logicalAxes != null) 'logicalAxes': logicalAxes, }); return NodeId.fromJson(result['nodeId'] as int); } @@ -1095,11 +1100,11 @@ enum PseudoType { scrollbarCorner('scrollbar-corner'), resizer('resizer'), inputListButton('input-list-button'), - pageTransition('page-transition'), - pageTransitionContainer('page-transition-container'), - pageTransitionImageWrapper('page-transition-image-wrapper'), - pageTransitionOutgoingImage('page-transition-outgoing-image'), - pageTransitionIncomingImage('page-transition-incoming-image'), + viewTransition('view-transition'), + viewTransitionGroup('view-transition-group'), + viewTransitionImagePair('view-transition-image-pair'), + viewTransitionOld('view-transition-old'), + viewTransitionNew('view-transition-new'), ; final String value; @@ -1155,6 +1160,46 @@ enum CompatibilityMode { String toString() => value.toString(); } +/// ContainerSelector physical axes +enum PhysicalAxes { + horizontal('Horizontal'), + vertical('Vertical'), + both('Both'), + ; + + final String value; + + const PhysicalAxes(this.value); + + factory PhysicalAxes.fromJson(String value) => + PhysicalAxes.values.firstWhere((e) => e.value == value); + + String toJson() => value; + + @override + String toString() => value.toString(); +} + +/// ContainerSelector logical axes +enum LogicalAxes { + inline('Inline'), + block('Block'), + both('Both'), + ; + + final String value; + + const LogicalAxes(this.value); + + factory LogicalAxes.fromJson(String value) => + LogicalAxes.values.firstWhere((e) => e.value == value); + + String toJson() => value; + + @override + String toString() => value.toString(); +} + /// DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. /// DOMNode is a base node mirror type. class Node { diff --git a/lib/protocol/fetch.dart b/lib/protocol/fetch.dart index 451dba07..603bdbe7 100644 --- a/lib/protocol/fetch.dart +++ b/lib/protocol/fetch.dart @@ -91,7 +91,9 @@ class FetchApi { /// [url] If set, the request url will be modified in a way that's not observable by page. /// [method] If set, the request method is overridden. /// [postData] If set, overrides the post data in the request. - /// [headers] If set, overrides the request headers. + /// [headers] If set, overrides the request headers. Note that the overrides do not + /// extend to subsequent redirect hops, if a redirect happens. Another override + /// may be applied to a different request produced by a redirect. /// [interceptResponse] If set, overrides response interception behavior for this request. Future continueRequest(RequestId requestId, {String? url, diff --git a/lib/protocol/headless_experimental.dart b/lib/protocol/headless_experimental.dart index 2985ee10..76367389 100644 --- a/lib/protocol/headless_experimental.dart +++ b/lib/protocol/headless_experimental.dart @@ -7,14 +7,6 @@ class HeadlessExperimentalApi { HeadlessExperimentalApi(this._client); - /// Issued when the target starts or stops needing BeginFrames. - /// Deprecated. Issue beginFrame unconditionally instead and use result from - /// beginFrame to detect whether the frames were suppressed. - Stream get onNeedsBeginFramesChanged => _client.onEvent - .where((event) => - event.name == 'HeadlessExperimental.needsBeginFramesChanged') - .map((event) => event.parameters['needsBeginFrames'] as bool); - /// Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a /// screenshot from the resulting frame. Requires that the target was created with enabled /// BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also @@ -44,11 +36,13 @@ class HeadlessExperimentalApi { } /// Disables headless events for the target. + @Deprecated('This command is deprecated') Future disable() async { await _client.send('HeadlessExperimental.disable'); } /// Enables headless events for the target. + @Deprecated('This command is deprecated') Future enable() async { await _client.send('HeadlessExperimental.enable'); } @@ -82,7 +76,10 @@ class ScreenshotParams { /// Compression quality from range [0..100] (jpeg only). final int? quality; - ScreenshotParams({this.format, this.quality}); + /// Optimize image encoding for speed, not for resulting size (defaults to false) + final bool? optimizeForSpeed; + + ScreenshotParams({this.format, this.quality, this.optimizeForSpeed}); factory ScreenshotParams.fromJson(Map json) { return ScreenshotParams( @@ -90,6 +87,9 @@ class ScreenshotParams { ? ScreenshotParamsFormat.fromJson(json['format'] as String) : null, quality: json.containsKey('quality') ? json['quality'] as int : null, + optimizeForSpeed: json.containsKey('optimizeForSpeed') + ? json['optimizeForSpeed'] as bool + : null, ); } @@ -97,6 +97,7 @@ class ScreenshotParams { return { if (format != null) 'format': format, if (quality != null) 'quality': quality, + if (optimizeForSpeed != null) 'optimizeForSpeed': optimizeForSpeed, }; } } @@ -104,6 +105,7 @@ class ScreenshotParams { enum ScreenshotParamsFormat { jpeg('jpeg'), png('png'), + webp('webp'), ; final String value; diff --git a/lib/protocol/network.dart b/lib/protocol/network.dart index b29e8cdf..3c1905f6 100644 --- a/lib/protocol/network.dart +++ b/lib/protocol/network.dart @@ -1287,12 +1287,16 @@ class RequestWillBeSentExtraInfoEvent { /// The client security state set for the request. final ClientSecurityState? clientSecurityState; + /// Whether the site has partitioned cookies stored in a partition different than the current one. + final bool? siteHasCookieInOtherPartition; + RequestWillBeSentExtraInfoEvent( {required this.requestId, required this.associatedCookies, required this.headers, required this.connectTiming, - this.clientSecurityState}); + this.clientSecurityState, + this.siteHasCookieInOtherPartition}); factory RequestWillBeSentExtraInfoEvent.fromJson(Map json) { return RequestWillBeSentExtraInfoEvent( @@ -1308,6 +1312,10 @@ class RequestWillBeSentExtraInfoEvent { ? ClientSecurityState.fromJson( json['clientSecurityState'] as Map) : null, + siteHasCookieInOtherPartition: + json.containsKey('siteHasCookieInOtherPartition') + ? json['siteHasCookieInOtherPartition'] as bool + : null, ); } } diff --git a/lib/protocol/page.dart b/lib/protocol/page.dart index 183c3406..ca3e42bd 100644 --- a/lib/protocol/page.dart +++ b/lib/protocol/page.dart @@ -207,13 +207,15 @@ class PageApi { /// [clip] Capture the screenshot of a given region only. /// [fromSurface] Capture the screenshot from the surface, rather than the view. Defaults to true. /// [captureBeyondViewport] Capture the screenshot beyond the viewport. Defaults to false. + /// [optimizeForSpeed] Optimize image encoding for speed, not for resulting size (defaults to false) /// Returns: Base64-encoded image data. Future captureScreenshot( {@Enum(['jpeg', 'png', 'webp']) String? format, int? quality, Viewport? clip, bool? fromSurface, - bool? captureBeyondViewport}) async { + bool? captureBeyondViewport, + bool? optimizeForSpeed}) async { assert(format == null || const ['jpeg', 'png', 'webp'].contains(format)); var result = await _client.send('Page.captureScreenshot', { if (format != null) 'format': format, @@ -222,6 +224,7 @@ class PageApi { if (fromSurface != null) 'fromSurface': fromSurface, if (captureBeyondViewport != null) 'captureBeyondViewport': captureBeyondViewport, + if (optimizeForSpeed != null) 'optimizeForSpeed': optimizeForSpeed, }); return result['data'] as String; } @@ -319,6 +322,15 @@ class PageApi { return GetAppIdResult.fromJson(result); } + /// Returns: Identifies the bottom-most script which caused the frame to be labelled + /// as an ad. Only sent if frame is labelled as an ad and id is available. + Future getAdScriptId(FrameId frameId) async { + var result = await _client.send('Page.getAdScriptId', { + 'frameId': frameId, + }); + return AdScriptId.fromJson(result['adScriptId'] as Map); + } + /// Returns all browser cookies for the page and all of its subframes. Depending /// on the backend support, will return detailed cookie information in the /// `cookies` field. @@ -872,15 +884,8 @@ class FrameAttachedEvent { /// JavaScript stack trace of when frame was attached, only set if frame initiated from script. final runtime.StackTraceData? stack; - /// Identifies the bottom-most script which caused the frame to be labelled - /// as an ad. Only sent if frame is labelled as an ad and id is available. - final AdScriptId? adScriptId; - FrameAttachedEvent( - {required this.frameId, - required this.parentFrameId, - this.stack, - this.adScriptId}); + {required this.frameId, required this.parentFrameId, this.stack}); factory FrameAttachedEvent.fromJson(Map json) { return FrameAttachedEvent( @@ -890,9 +895,6 @@ class FrameAttachedEvent { ? runtime.StackTraceData.fromJson( json['stack'] as Map) : null, - adScriptId: json.containsKey('adScriptId') - ? AdScriptId.fromJson(json['adScriptId'] as Map) - : null, ); } } @@ -1651,6 +1653,7 @@ enum PermissionsPolicyFeature { chWidth('ch-width'), clipboardRead('clipboard-read'), clipboardWrite('clipboard-write'), + computePressure('compute-pressure'), crossOriginIsolated('cross-origin-isolated'), directSockets('direct-sockets'), displayCapture('display-capture'), @@ -2933,7 +2936,6 @@ enum BackForwardCacheNotRestoredReason { dedicatedWorkerOrWorklet('DedicatedWorkerOrWorklet'), outstandingNetworkRequestOthers('OutstandingNetworkRequestOthers'), outstandingIndexedDbTransaction('OutstandingIndexedDBTransaction'), - requestedNotificationsPermission('RequestedNotificationsPermission'), requestedMidiPermission('RequestedMIDIPermission'), requestedAudioCapturePermission('RequestedAudioCapturePermission'), requestedVideoCapturePermission('RequestedVideoCapturePermission'), @@ -2966,6 +2968,7 @@ enum BackForwardCacheNotRestoredReason { 'OutstandingNetworkRequestDirectSocket'), injectedJavascript('InjectedJavascript'), injectedStyleSheet('InjectedStyleSheet'), + keepaliveRequest('KeepaliveRequest'), dummy('Dummy'), contentSecurityHandler('ContentSecurityHandler'), contentWebAuthenticationApi('ContentWebAuthenticationAPI'), @@ -3111,8 +3114,6 @@ enum PrerenderFinalStatus { activated('Activated'), destroyed('Destroyed'), lowEndDevice('LowEndDevice'), - crossOriginRedirect('CrossOriginRedirect'), - crossOriginNavigation('CrossOriginNavigation'), invalidSchemeRedirect('InvalidSchemeRedirect'), invalidSchemeNavigation('InvalidSchemeNavigation'), inProgressNavigation('InProgressNavigation'), @@ -3148,6 +3149,15 @@ enum PrerenderFinalStatus { inactivePageRestriction('InactivePageRestriction'), startFailed('StartFailed'), timeoutBackgrounded('TimeoutBackgrounded'), + crossSiteRedirect('CrossSiteRedirect'), + crossSiteNavigation('CrossSiteNavigation'), + sameSiteCrossOriginRedirect('SameSiteCrossOriginRedirect'), + sameSiteCrossOriginNavigation('SameSiteCrossOriginNavigation'), + sameSiteCrossOriginRedirectNotOptIn('SameSiteCrossOriginRedirectNotOptIn'), + sameSiteCrossOriginNavigationNotOptIn( + 'SameSiteCrossOriginNavigationNotOptIn'), + activationNavigationParameterMismatch( + 'ActivationNavigationParameterMismatch'), ; final String value; diff --git a/lib/protocol/profiler.dart b/lib/protocol/profiler.dart index 2d7418e1..d458ab6d 100644 --- a/lib/protocol/profiler.dart +++ b/lib/protocol/profiler.dart @@ -77,11 +77,6 @@ class ProfilerApi { return result['timestamp'] as num; } - /// Enable type profile. - Future startTypeProfile() async { - await _client.send('Profiler.startTypeProfile'); - } - /// Returns: Recorded profile. Future stop() async { var result = await _client.send('Profiler.stop'); @@ -94,26 +89,12 @@ class ProfilerApi { await _client.send('Profiler.stopPreciseCoverage'); } - /// Disable type profile. Disabling releases type profile data collected so far. - Future stopTypeProfile() async { - await _client.send('Profiler.stopTypeProfile'); - } - /// Collect coverage data for the current isolate, and resets execution counters. Precise code /// coverage needs to have started. Future takePreciseCoverage() async { var result = await _client.send('Profiler.takePreciseCoverage'); return TakePreciseCoverageResult.fromJson(result); } - - /// Collect type profile. - /// Returns: Type profile for all scripts since startTypeProfile() was turned on. - Future> takeTypeProfile() async { - var result = await _client.send('Profiler.takeTypeProfile'); - return (result['result'] as List) - .map((e) => ScriptTypeProfile.fromJson(e as Map)) - .toList(); - } } class ConsoleProfileFinishedEvent { @@ -448,83 +429,3 @@ class ScriptCoverage { }; } } - -/// Describes a type collected during runtime. -class TypeObject { - /// Name of a type collected with type profiling. - final String name; - - TypeObject({required this.name}); - - factory TypeObject.fromJson(Map json) { - return TypeObject( - name: json['name'] as String, - ); - } - - Map toJson() { - return { - 'name': name, - }; - } -} - -/// Source offset and types for a parameter or return value. -class TypeProfileEntry { - /// Source offset of the parameter or end of function for return values. - final int offset; - - /// The types for this parameter or return value. - final List types; - - TypeProfileEntry({required this.offset, required this.types}); - - factory TypeProfileEntry.fromJson(Map json) { - return TypeProfileEntry( - offset: json['offset'] as int, - types: (json['types'] as List) - .map((e) => TypeObject.fromJson(e as Map)) - .toList(), - ); - } - - Map toJson() { - return { - 'offset': offset, - 'types': types.map((e) => e.toJson()).toList(), - }; - } -} - -/// Type profile data collected during runtime for a JavaScript script. -class ScriptTypeProfile { - /// JavaScript script id. - final runtime.ScriptId scriptId; - - /// JavaScript script name or url. - final String url; - - /// Type profile entries for parameters and return values of the functions in the script. - final List entries; - - ScriptTypeProfile( - {required this.scriptId, required this.url, required this.entries}); - - factory ScriptTypeProfile.fromJson(Map json) { - return ScriptTypeProfile( - scriptId: runtime.ScriptId.fromJson(json['scriptId'] as String), - url: json['url'] as String, - entries: (json['entries'] as List) - .map((e) => TypeProfileEntry.fromJson(e as Map)) - .toList(), - ); - } - - Map toJson() { - return { - 'scriptId': scriptId.toJson(), - 'url': url, - 'entries': entries.map((e) => e.toJson()).toList(), - }; - } -} diff --git a/lib/protocol/storage.dart b/lib/protocol/storage.dart index ae7ea212..a7ad6b45 100644 --- a/lib/protocol/storage.dart +++ b/lib/protocol/storage.dart @@ -39,6 +39,13 @@ class StorageApi { .where((event) => event.name == 'Storage.interestGroupAccessed') .map((event) => InterestGroupAccessedEvent.fromJson(event.parameters)); + /// Shared storage was accessed by the associated page. + /// The following parameters are included in all events. + Stream get onSharedStorageAccessed => _client + .onEvent + .where((event) => event.name == 'Storage.sharedStorageAccessed') + .map((event) => SharedStorageAccessedEvent.fromJson(event.parameters)); + /// Returns a storage key given a frame id. Future getStorageKeyForFrame( page.FrameId frameId) async { @@ -211,6 +218,63 @@ class StorageApi { 'enable': enable, }); } + + /// Gets metadata for an origin's shared storage. + Future getSharedStorageMetadata( + String ownerOrigin) async { + var result = await _client.send('Storage.getSharedStorageMetadata', { + 'ownerOrigin': ownerOrigin, + }); + return SharedStorageMetadata.fromJson( + result['metadata'] as Map); + } + + /// Gets the entries in an given origin's shared storage. + Future> getSharedStorageEntries( + String ownerOrigin) async { + var result = await _client.send('Storage.getSharedStorageEntries', { + 'ownerOrigin': ownerOrigin, + }); + return (result['entries'] as List) + .map((e) => SharedStorageEntry.fromJson(e as Map)) + .toList(); + } + + /// Sets entry with `key` and `value` for a given origin's shared storage. + /// [ignoreIfPresent] If `ignoreIfPresent` is included and true, then only sets the entry if + /// `key` doesn't already exist. + Future setSharedStorageEntry( + String ownerOrigin, String key, String value, + {bool? ignoreIfPresent}) async { + await _client.send('Storage.setSharedStorageEntry', { + 'ownerOrigin': ownerOrigin, + 'key': key, + 'value': value, + if (ignoreIfPresent != null) 'ignoreIfPresent': ignoreIfPresent, + }); + } + + /// Deletes entry for `key` (if it exists) for a given origin's shared storage. + Future deleteSharedStorageEntry(String ownerOrigin, String key) async { + await _client.send('Storage.deleteSharedStorageEntry', { + 'ownerOrigin': ownerOrigin, + 'key': key, + }); + } + + /// Clears all entries for a given origin's shared storage. + Future clearSharedStorageEntries(String ownerOrigin) async { + await _client.send('Storage.clearSharedStorageEntries', { + 'ownerOrigin': ownerOrigin, + }); + } + + /// Enables/disables issuing of sharedStorageAccessed events. + Future setSharedStorageTracking(bool enable) async { + await _client.send('Storage.setSharedStorageTracking', { + 'enable': enable, + }); + } } class CacheStorageContentUpdatedEvent { @@ -302,6 +366,42 @@ class InterestGroupAccessedEvent { } } +class SharedStorageAccessedEvent { + /// Time of the access. + final network.TimeSinceEpoch accessTime; + + /// Enum value indicating the Shared Storage API method invoked. + final SharedStorageAccessType type; + + /// DevTools Frame Token for the primary frame tree's root. + final page.FrameId mainFrameId; + + /// Serialized origin for the context that invoked the Shared Storage API. + final String ownerOrigin; + + /// The sub-parameters warapped by `params` are all optional and their + /// presence/absence depends on `type`. + final SharedStorageAccessParams params; + + SharedStorageAccessedEvent( + {required this.accessTime, + required this.type, + required this.mainFrameId, + required this.ownerOrigin, + required this.params}); + + factory SharedStorageAccessedEvent.fromJson(Map json) { + return SharedStorageAccessedEvent( + accessTime: network.TimeSinceEpoch.fromJson(json['accessTime'] as num), + type: SharedStorageAccessType.fromJson(json['type'] as String), + mainFrameId: page.FrameId.fromJson(json['mainFrameId'] as String), + ownerOrigin: json['ownerOrigin'] as String, + params: SharedStorageAccessParams.fromJson( + json['params'] as Map), + ); + } +} + class GetUsageAndQuotaResult { /// Storage usage (bytes). final num usage; @@ -366,6 +466,7 @@ enum StorageType { serviceWorkers('service_workers'), cacheStorage('cache_storage'), interestGroups('interest_groups'), + sharedStorage('shared_storage'), all('all'), other('other'), ; @@ -569,3 +670,234 @@ class InterestGroupDetails { }; } } + +/// Enum of shared storage access types. +enum SharedStorageAccessType { + documentAddModule('documentAddModule'), + documentSelectUrl('documentSelectURL'), + documentRun('documentRun'), + documentSet('documentSet'), + documentAppend('documentAppend'), + documentDelete('documentDelete'), + documentClear('documentClear'), + workletSet('workletSet'), + workletAppend('workletAppend'), + workletDelete('workletDelete'), + workletClear('workletClear'), + workletGet('workletGet'), + workletKeys('workletKeys'), + workletEntries('workletEntries'), + workletLength('workletLength'), + workletRemainingBudget('workletRemainingBudget'), + ; + + final String value; + + const SharedStorageAccessType(this.value); + + factory SharedStorageAccessType.fromJson(String value) => + SharedStorageAccessType.values.firstWhere((e) => e.value == value); + + String toJson() => value; + + @override + String toString() => value.toString(); +} + +/// Struct for a single key-value pair in an origin's shared storage. +class SharedStorageEntry { + final String key; + + final String value; + + SharedStorageEntry({required this.key, required this.value}); + + factory SharedStorageEntry.fromJson(Map json) { + return SharedStorageEntry( + key: json['key'] as String, + value: json['value'] as String, + ); + } + + Map toJson() { + return { + 'key': key, + 'value': value, + }; + } +} + +/// Details for an origin's shared storage. +class SharedStorageMetadata { + final network.TimeSinceEpoch creationTime; + + final int length; + + final num remainingBudget; + + SharedStorageMetadata( + {required this.creationTime, + required this.length, + required this.remainingBudget}); + + factory SharedStorageMetadata.fromJson(Map json) { + return SharedStorageMetadata( + creationTime: + network.TimeSinceEpoch.fromJson(json['creationTime'] as num), + length: json['length'] as int, + remainingBudget: json['remainingBudget'] as num, + ); + } + + Map toJson() { + return { + 'creationTime': creationTime.toJson(), + 'length': length, + 'remainingBudget': remainingBudget, + }; + } +} + +/// Pair of reporting metadata details for a candidate URL for `selectURL()`. +class SharedStorageReportingMetadata { + final String eventType; + + final String reportingUrl; + + SharedStorageReportingMetadata( + {required this.eventType, required this.reportingUrl}); + + factory SharedStorageReportingMetadata.fromJson(Map json) { + return SharedStorageReportingMetadata( + eventType: json['eventType'] as String, + reportingUrl: json['reportingUrl'] as String, + ); + } + + Map toJson() { + return { + 'eventType': eventType, + 'reportingUrl': reportingUrl, + }; + } +} + +/// Bundles a candidate URL with its reporting metadata. +class SharedStorageUrlWithMetadata { + /// Spec of candidate URL. + final String url; + + /// Any associated reporting metadata. + final List reportingMetadata; + + SharedStorageUrlWithMetadata( + {required this.url, required this.reportingMetadata}); + + factory SharedStorageUrlWithMetadata.fromJson(Map json) { + return SharedStorageUrlWithMetadata( + url: json['url'] as String, + reportingMetadata: (json['reportingMetadata'] as List) + .map((e) => SharedStorageReportingMetadata.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + return { + 'url': url, + 'reportingMetadata': reportingMetadata.map((e) => e.toJson()).toList(), + }; + } +} + +/// Bundles the parameters for shared storage access events whose +/// presence/absence can vary according to SharedStorageAccessType. +class SharedStorageAccessParams { + /// Spec of the module script URL. + /// Present only for SharedStorageAccessType.documentAddModule. + final String? scriptSourceUrl; + + /// Name of the registered operation to be run. + /// Present only for SharedStorageAccessType.documentRun and + /// SharedStorageAccessType.documentSelectURL. + final String? operationName; + + /// The operation's serialized data in bytes (converted to a string). + /// Present only for SharedStorageAccessType.documentRun and + /// SharedStorageAccessType.documentSelectURL. + final String? serializedData; + + /// Array of candidate URLs' specs, along with any associated metadata. + /// Present only for SharedStorageAccessType.documentSelectURL. + final List? urlsWithMetadata; + + /// Key for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessType.documentSet, + /// SharedStorageAccessType.documentAppend, + /// SharedStorageAccessType.documentDelete, + /// SharedStorageAccessType.workletSet, + /// SharedStorageAccessType.workletAppend, + /// SharedStorageAccessType.workletDelete, and + /// SharedStorageAccessType.workletGet. + final String? key; + + /// Value for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessType.documentSet, + /// SharedStorageAccessType.documentAppend, + /// SharedStorageAccessType.workletSet, and + /// SharedStorageAccessType.workletAppend. + final String? value; + + /// Whether or not to set an entry for a key if that key is already present. + /// Present only for SharedStorageAccessType.documentSet and + /// SharedStorageAccessType.workletSet. + final bool? ignoreIfPresent; + + SharedStorageAccessParams( + {this.scriptSourceUrl, + this.operationName, + this.serializedData, + this.urlsWithMetadata, + this.key, + this.value, + this.ignoreIfPresent}); + + factory SharedStorageAccessParams.fromJson(Map json) { + return SharedStorageAccessParams( + scriptSourceUrl: json.containsKey('scriptSourceUrl') + ? json['scriptSourceUrl'] as String + : null, + operationName: json.containsKey('operationName') + ? json['operationName'] as String + : null, + serializedData: json.containsKey('serializedData') + ? json['serializedData'] as String + : null, + urlsWithMetadata: json.containsKey('urlsWithMetadata') + ? (json['urlsWithMetadata'] as List) + .map((e) => SharedStorageUrlWithMetadata.fromJson( + e as Map)) + .toList() + : null, + key: json.containsKey('key') ? json['key'] as String : null, + value: json.containsKey('value') ? json['value'] as String : null, + ignoreIfPresent: json.containsKey('ignoreIfPresent') + ? json['ignoreIfPresent'] as bool + : null, + ); + } + + Map toJson() { + return { + if (scriptSourceUrl != null) 'scriptSourceUrl': scriptSourceUrl, + if (operationName != null) 'operationName': operationName, + if (serializedData != null) 'serializedData': serializedData, + if (urlsWithMetadata != null) + 'urlsWithMetadata': urlsWithMetadata!.map((e) => e.toJson()).toList(), + if (key != null) 'key': key, + if (value != null) 'value': value, + if (ignoreIfPresent != null) 'ignoreIfPresent': ignoreIfPresent, + }; + } +} diff --git a/lib/protocol/web_authn.dart b/lib/protocol/web_authn.dart index 9fcc1c97..887c08ab 100644 --- a/lib/protocol/web_authn.dart +++ b/lib/protocol/web_authn.dart @@ -35,6 +35,23 @@ class WebAuthnApi { return AuthenticatorId.fromJson(result['authenticatorId'] as String); } + /// Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + /// [isBogusSignature] If isBogusSignature is set, overrides the signature in the authenticator response to be zero. + /// Defaults to false. + /// [isBadUV] If isBadUV is set, overrides the UV bit in the flags in the authenticator response to + /// be zero. Defaults to false. + /// [isBadUP] If isBadUP is set, overrides the UP bit in the flags in the authenticator response to + /// be zero. Defaults to false. + Future setResponseOverrideBits(AuthenticatorId authenticatorId, + {bool? isBogusSignature, bool? isBadUV, bool? isBadUP}) async { + await _client.send('WebAuthn.setResponseOverrideBits', { + 'authenticatorId': authenticatorId, + if (isBogusSignature != null) 'isBogusSignature': isBogusSignature, + if (isBadUV != null) 'isBadUV': isBadUV, + if (isBadUP != null) 'isBadUP': isBadUP, + }); + } + /// Removes the given authenticator. Future removeVirtualAuthenticator( AuthenticatorId authenticatorId) async { diff --git a/lib/src/downloader.dart b/lib/src/downloader.dart index aaa35d11..acdad5fe 100644 --- a/lib/src/downloader.dart +++ b/lib/src/downloader.dart @@ -4,7 +4,7 @@ import 'package:archive/archive.dart'; import 'package:http/http.dart' as http; import 'package:path/path.dart' as p; -const int _lastRevision = 1056772; +const int _lastRevision = 1069273; class RevisionInfo { final String executablePath; diff --git a/pubspec.lock b/pubspec.lock index b40e2d6f..548bdce3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "50.0.0" + version: "51.0.0" analyzer: dependency: "direct dev" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "5.3.1" archive: dependency: "direct main" description: @@ -294,7 +294,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.8.3" petitparser: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 275019d6..2c37215b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: puppeteer description: A high-level API to control headless Chrome over the DevTools Protocol. This is a port of Puppeteer in Dart. -version: 2.18.0 +version: 2.19.0 homepage: https://github.com/xvrh/puppeteer-dart platforms: diff --git a/tool/json/browser_protocol.json b/tool/json/browser_protocol.json index 61c5d23c..39b18382 100644 --- a/tool/json/browser_protocol.json +++ b/tool/json/browser_protocol.json @@ -992,7 +992,8 @@ "ExcludeSameSiteStrict", "ExcludeInvalidSameParty", "ExcludeSamePartyCrossPartyContext", - "ExcludeDomainNonASCII" + "ExcludeDomainNonASCII", + "ExcludeThirdPartyCookieBlockedInFirstPartySet" ] }, { @@ -1996,6 +1997,11 @@ "items": { "$ref": "EventMetadata" } + }, + { + "name": "storageKey", + "description": "Storage key this event belongs to.", + "type": "string" } ] } @@ -2152,6 +2158,8 @@ "durableStorage", "flash", "geolocation", + "idleDetection", + "localFonts", "midi", "midiSysex", "nfc", @@ -2160,11 +2168,12 @@ "periodicBackgroundSync", "protectedMediaIdentifier", "sensors", + "storageAccess", "videoCapture", "videoCapturePanTiltZoom", - "idleDetection", "wakeLockScreen", - "wakeLockSystem" + "wakeLockSystem", + "windowManagement" ] }, { @@ -3313,6 +3322,18 @@ "description": "Optional name for the container.", "optional": true, "type": "string" + }, + { + "name": "physicalAxes", + "description": "Optional physical axes queried for the container.", + "optional": true, + "$ref": "DOM.PhysicalAxes" + }, + { + "name": "logicalAxes", + "description": "Optional logical axes queried for the container.", + "optional": true, + "$ref": "DOM.LogicalAxes" } ] }, @@ -4358,6 +4379,11 @@ "description": "Security origin of the cache.", "type": "string" }, + { + "name": "storageKey", + "description": "Storage key of the cache.", + "type": "string" + }, { "name": "cacheName", "description": "The name of the cache.", @@ -4426,7 +4452,14 @@ "parameters": [ { "name": "securityOrigin", - "description": "Security origin.", + "description": "At least and at most one of securityOrigin, storageKey must be specified.\nSecurity origin.", + "optional": true, + "type": "string" + }, + { + "name": "storageKey", + "description": "Storage key.", + "optional": true, "type": "string" } ], @@ -4690,11 +4723,11 @@ "scrollbar-corner", "resizer", "input-list-button", - "page-transition", - "page-transition-container", - "page-transition-image-wrapper", - "page-transition-outgoing-image", - "page-transition-incoming-image" + "view-transition", + "view-transition-group", + "view-transition-image-pair", + "view-transition-old", + "view-transition-new" ] }, { @@ -4717,6 +4750,26 @@ "NoQuirksMode" ] }, + { + "id": "PhysicalAxes", + "description": "ContainerSelector physical axes", + "type": "string", + "enum": [ + "Horizontal", + "Vertical", + "Both" + ] + }, + { + "id": "LogicalAxes", + "description": "ContainerSelector logical axes", + "type": "string", + "enum": [ + "Inline", + "Block", + "Both" + ] + }, { "id": "Node", "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.\nDOMNode is a base node mirror type.", @@ -6078,7 +6131,7 @@ }, { "name": "getContainerForNode", - "description": "Returns the container of the given node based on container query conditions.\nIf containerName is given, it will find the nearest container with a matching name;\notherwise it will find the nearest container regardless of its container name.", + "description": "Returns the query container of the given node based on container query\nconditions: containerName, physical, and logical axes. If no axes are\nprovided, the style container is returned, which is the direct parent or the\nclosest element with a matching container-name.", "experimental": true, "parameters": [ { @@ -6089,6 +6142,16 @@ "name": "containerName", "optional": true, "type": "string" + }, + { + "name": "physicalAxes", + "optional": true, + "$ref": "PhysicalAxes" + }, + { + "name": "logicalAxes", + "optional": true, + "$ref": "LogicalAxes" } ], "returns": [ @@ -8588,25 +8651,13 @@ }, { "name": "disable", - "description": "Disables headless events for the target." + "description": "Disables headless events for the target.", + "deprecated": true }, { "name": "enable", - "description": "Enables headless events for the target." - } - ], - "events": [ - { - "name": "needsBeginFramesChanged", - "description": "Issued when the target starts or stops needing BeginFrames.\nDeprecated. Issue beginFrame unconditionally instead and use result from\nbeginFrame to detect whether the frames were suppressed.", - "deprecated": true, - "parameters": [ - { - "name": "needsBeginFrames", - "description": "True if BeginFrames are needed, false otherwise.", - "type": "boolean" - } - ] + "description": "Enables headless events for the target.", + "deprecated": true } ] }, @@ -11778,6 +11829,7 @@ "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", + "ThirdPartyBlockedInFirstPartySet", "SyntaxError", "SchemeNotSupported", "OverwriteSecure", @@ -11806,6 +11858,7 @@ "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", + "ThirdPartyBlockedInFirstPartySet", "UnknownError", "SchemefulSameSiteStrict", "SchemefulSameSiteLax", @@ -13814,6 +13867,12 @@ "description": "The client security state set for the request.", "optional": true, "$ref": "ClientSecurityState" + }, + { + "name": "siteHasCookieInOtherPartition", + "description": "Whether the site has partitioned cookies stored in a partition different than the current one.", + "optional": true, + "type": "boolean" } ] }, @@ -15280,6 +15339,7 @@ "ch-width", "clipboard-read", "clipboard-write", + "compute-pressure", "cross-origin-isolated", "direct-sockets", "display-capture", @@ -16202,7 +16262,6 @@ "DedicatedWorkerOrWorklet", "OutstandingNetworkRequestOthers", "OutstandingIndexedDBTransaction", - "RequestedNotificationsPermission", "RequestedMIDIPermission", "RequestedAudioCapturePermission", "RequestedVideoCapturePermission", @@ -16235,6 +16294,7 @@ "InjectedStyleSheet", "KeepaliveRequest", "Dummy", + "AuthorizationHeader", "ContentSecurityHandler", "ContentWebAuthenticationAPI", "ContentFileChooser", @@ -17525,8 +17585,9 @@ "type": "string", "enum": [ "none", - "autoaccept", - "autoreject" + "autoAccept", + "autoReject", + "autoOptOut" ] } ] @@ -19133,6 +19194,7 @@ "join", "leave", "update", + "loaded", "bid", "win" ] @@ -19222,6 +19284,29 @@ } ] }, + { + "id": "SharedStorageAccessType", + "description": "Enum of shared storage access types.", + "type": "string", + "enum": [ + "documentAddModule", + "documentSelectURL", + "documentRun", + "documentSet", + "documentAppend", + "documentDelete", + "documentClear", + "workletSet", + "workletAppend", + "workletDelete", + "workletClear", + "workletGet", + "workletKeys", + "workletEntries", + "workletLength", + "workletRemainingBudget" + ] + }, { "id": "SharedStorageEntry", "description": "Struct for a single key-value pair in an origin's shared storage.", @@ -19255,6 +19340,93 @@ "type": "number" } ] + }, + { + "id": "SharedStorageReportingMetadata", + "description": "Pair of reporting metadata details for a candidate URL for `selectURL()`.", + "type": "object", + "properties": [ + { + "name": "eventType", + "type": "string" + }, + { + "name": "reportingUrl", + "type": "string" + } + ] + }, + { + "id": "SharedStorageUrlWithMetadata", + "description": "Bundles a candidate URL with its reporting metadata.", + "type": "object", + "properties": [ + { + "name": "url", + "description": "Spec of candidate URL.", + "type": "string" + }, + { + "name": "reportingMetadata", + "description": "Any associated reporting metadata.", + "type": "array", + "items": { + "$ref": "SharedStorageReportingMetadata" + } + } + ] + }, + { + "id": "SharedStorageAccessParams", + "description": "Bundles the parameters for shared storage access events whose\npresence/absence can vary according to SharedStorageAccessType.", + "type": "object", + "properties": [ + { + "name": "scriptSourceUrl", + "description": "Spec of the module script URL.\nPresent only for SharedStorageAccessType.documentAddModule.", + "optional": true, + "type": "string" + }, + { + "name": "operationName", + "description": "Name of the registered operation to be run.\nPresent only for SharedStorageAccessType.documentRun and\nSharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "string" + }, + { + "name": "serializedData", + "description": "The operation's serialized data in bytes (converted to a string).\nPresent only for SharedStorageAccessType.documentRun and\nSharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "string" + }, + { + "name": "urlsWithMetadata", + "description": "Array of candidate URLs' specs, along with any associated metadata.\nPresent only for SharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "array", + "items": { + "$ref": "SharedStorageUrlWithMetadata" + } + }, + { + "name": "key", + "description": "Key for a specific entry in an origin's shared storage.\nPresent only for SharedStorageAccessType.documentSet,\nSharedStorageAccessType.documentAppend,\nSharedStorageAccessType.documentDelete,\nSharedStorageAccessType.workletSet,\nSharedStorageAccessType.workletAppend,\nSharedStorageAccessType.workletDelete, and\nSharedStorageAccessType.workletGet.", + "optional": true, + "type": "string" + }, + { + "name": "value", + "description": "Value for a specific entry in an origin's shared storage.\nPresent only for SharedStorageAccessType.documentSet,\nSharedStorageAccessType.documentAppend,\nSharedStorageAccessType.workletSet, and\nSharedStorageAccessType.workletAppend.", + "optional": true, + "type": "string" + }, + { + "name": "ignoreIfPresent", + "description": "Whether or not to set an entry for a key if that key is already present.\nPresent only for SharedStorageAccessType.documentSet and\nSharedStorageAccessType.workletSet.", + "optional": true, + "type": "boolean" + } + ] } ], "commands": [ @@ -19425,6 +19597,17 @@ } ] }, + { + "name": "trackCacheStorageForStorageKey", + "description": "Registers storage key to be notified when an update occurs to its cache storage list.", + "parameters": [ + { + "name": "storageKey", + "description": "Storage key.", + "type": "string" + } + ] + }, { "name": "trackIndexedDBForOrigin", "description": "Registers origin to be notified when an update occurs to its IndexedDB.", @@ -19458,6 +19641,17 @@ } ] }, + { + "name": "untrackCacheStorageForStorageKey", + "description": "Unregisters storage key from receiving notifications for cache storage.", + "parameters": [ + { + "name": "storageKey", + "description": "Storage key.", + "type": "string" + } + ] + }, { "name": "untrackIndexedDBForOrigin", "description": "Unregisters origin from receiving notifications for IndexedDB.", @@ -19580,6 +19774,68 @@ } } ] + }, + { + "name": "setSharedStorageEntry", + "description": "Sets entry with `key` and `value` for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "value", + "type": "string" + }, + { + "name": "ignoreIfPresent", + "description": "If `ignoreIfPresent` is included and true, then only sets the entry if\n`key` doesn't already exist.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "deleteSharedStorageEntry", + "description": "Deletes entry for `key` (if it exists) for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "key", + "type": "string" + } + ] + }, + { + "name": "clearSharedStorageEntries", + "description": "Clears all entries for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + } + ] + }, + { + "name": "setSharedStorageTracking", + "description": "Enables/disables issuing of sharedStorageAccessed events.", + "experimental": true, + "parameters": [ + { + "name": "enable", + "type": "boolean" + } + ] } ], "events": [ @@ -19592,6 +19848,11 @@ "description": "Origin to update.", "type": "string" }, + { + "name": "storageKey", + "description": "Storage key to update.", + "type": "string" + }, { "name": "cacheName", "description": "Name of cache in origin.", @@ -19607,6 +19868,11 @@ "name": "origin", "description": "Origin to update.", "type": "string" + }, + { + "name": "storageKey", + "description": "Storage key to update.", + "type": "string" } ] }, @@ -19673,6 +19939,37 @@ "type": "string" } ] + }, + { + "name": "sharedStorageAccessed", + "description": "Shared storage was accessed by the associated page.\nThe following parameters are included in all events.", + "parameters": [ + { + "name": "accessTime", + "description": "Time of the access.", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "type", + "description": "Enum value indicating the Shared Storage API method invoked.", + "$ref": "SharedStorageAccessType" + }, + { + "name": "mainFrameId", + "description": "DevTools Frame Token for the primary frame tree's root.", + "$ref": "Page.FrameId" + }, + { + "name": "ownerOrigin", + "description": "Serialized origin for the context that invoked the Shared Storage API.", + "type": "string" + }, + { + "name": "params", + "description": "The sub-parameters warapped by `params` are all optional and their\npresence/absence depends on `type`.", + "$ref": "SharedStorageAccessParams" + } + ] } ] }, @@ -20901,7 +21198,7 @@ }, { "name": "dataCollected", - "description": "Contains an bucket of collected trace events. When tracing is stopped collected events will be\nsend as a sequence of dataCollected events followed by tracingComplete event.", + "description": "Contains a bucket of collected trace events. When tracing is stopped collected events will be\nsent as a sequence of dataCollected events followed by tracingComplete event.", "parameters": [ { "name": "value", @@ -22030,6 +22327,34 @@ } ] }, + { + "name": "setResponseOverrideBits", + "description": "Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.", + "parameters": [ + { + "name": "authenticatorId", + "$ref": "AuthenticatorId" + }, + { + "name": "isBogusSignature", + "description": "If isBogusSignature is set, overrides the signature in the authenticator response to be zero.\nDefaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "isBadUV", + "description": "If isBadUV is set, overrides the UV bit in the flags in the authenticator response to\nbe zero. Defaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "isBadUP", + "description": "If isBadUP is set, overrides the UP bit in the flags in the authenticator response to\nbe zero. Defaults to false.", + "optional": true, + "type": "boolean" + } + ] + }, { "name": "removeVirtualAuthenticator", "description": "Removes the given authenticator.", @@ -22145,6 +22470,36 @@ } ] } + ], + "events": [ + { + "name": "credentialAdded", + "description": "Triggered when a credential is added to an authenticator.", + "parameters": [ + { + "name": "authenticatorId", + "$ref": "AuthenticatorId" + }, + { + "name": "credential", + "$ref": "Credential" + } + ] + }, + { + "name": "credentialAsserted", + "description": "Triggered when a credential is used in a webauthn assertion.", + "parameters": [ + { + "name": "authenticatorId", + "$ref": "AuthenticatorId" + }, + { + "name": "credential", + "$ref": "Credential" + } + ] + } ] }, { diff --git a/tool/json/js_protocol.json b/tool/json/js_protocol.json index d8ea084f..4bbf66f9 100644 --- a/tool/json/js_protocol.json +++ b/tool/json/js_protocol.json @@ -968,7 +968,7 @@ }, { "name": "setPauseOnExceptions", - "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or\nno exceptions. Initial pause on exceptions state is `none`.", + "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,\nor caught exceptions, no exceptions. Initial pause on exceptions state is `none`.", "parameters": [ { "name": "state", @@ -976,6 +976,7 @@ "type": "string", "enum": [ "none", + "caught", "uncaught", "all" ] diff --git a/tool/json/protocol_from_chrome.json b/tool/json/protocol_from_chrome.json index f3d276a7..512a9330 100644 --- a/tool/json/protocol_from_chrome.json +++ b/tool/json/protocol_from_chrome.json @@ -2152,6 +2152,8 @@ "durableStorage", "flash", "geolocation", + "idleDetection", + "localFonts", "midi", "midiSysex", "nfc", @@ -2160,11 +2162,12 @@ "periodicBackgroundSync", "protectedMediaIdentifier", "sensors", + "storageAccess", "videoCapture", "videoCapturePanTiltZoom", - "idleDetection", "wakeLockScreen", - "wakeLockSystem" + "wakeLockSystem", + "windowManagement" ] }, { @@ -2173,8 +2176,7 @@ "type": "string", "enum": [ "granted", - "denied", - "prompt" + "denied" ] }, { @@ -3313,6 +3315,18 @@ "description": "Optional name for the container.", "optional": true, "type": "string" + }, + { + "name": "physicalAxes", + "description": "Optional physical axes queried for the container.", + "optional": true, + "$ref": "DOM.PhysicalAxes" + }, + { + "name": "logicalAxes", + "description": "Optional logical axes queried for the container.", + "optional": true, + "$ref": "DOM.LogicalAxes" } ] }, @@ -4690,11 +4704,11 @@ "scrollbar-corner", "resizer", "input-list-button", - "page-transition", - "page-transition-container", - "page-transition-image-wrapper", - "page-transition-outgoing-image", - "page-transition-incoming-image" + "view-transition", + "view-transition-group", + "view-transition-image-pair", + "view-transition-old", + "view-transition-new" ] }, { @@ -4717,6 +4731,26 @@ "NoQuirksMode" ] }, + { + "id": "PhysicalAxes", + "description": "ContainerSelector physical axes", + "type": "string", + "enum": [ + "Horizontal", + "Vertical", + "Both" + ] + }, + { + "id": "LogicalAxes", + "description": "ContainerSelector logical axes", + "type": "string", + "enum": [ + "Inline", + "Block", + "Both" + ] + }, { "id": "Node", "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.\nDOMNode is a base node mirror type.", @@ -6078,7 +6112,7 @@ }, { "name": "getContainerForNode", - "description": "Returns the container of the given node based on container query conditions.\nIf containerName is given, it will find the nearest container with a matching name;\notherwise it will find the nearest container regardless of its container name.", + "description": "Returns the query container of the given node based on container query\nconditions: containerName, physical, and logical axes. If no axes are\nprovided, the style container is returned, which is the direct parent or the\nclosest element with a matching container-name.", "experimental": true, "parameters": [ { @@ -6089,6 +6123,16 @@ "name": "containerName", "optional": true, "type": "string" + }, + { + "name": "physicalAxes", + "optional": true, + "$ref": "PhysicalAxes" + }, + { + "name": "logicalAxes", + "optional": true, + "$ref": "LogicalAxes" } ], "returns": [ @@ -8523,7 +8567,8 @@ "type": "string", "enum": [ "jpeg", - "png" + "png", + "webp" ] }, { @@ -8531,6 +8576,12 @@ "description": "Compression quality from range [0..100] (jpeg only).", "optional": true, "type": "integer" + }, + { + "name": "optimizeForSpeed", + "description": "Optimize image encoding for speed, not for resulting size (defaults to false)", + "optional": true, + "type": "boolean" } ] } @@ -8581,25 +8632,13 @@ }, { "name": "disable", - "description": "Disables headless events for the target." + "description": "Disables headless events for the target.", + "deprecated": true }, { "name": "enable", - "description": "Enables headless events for the target." - } - ], - "events": [ - { - "name": "needsBeginFramesChanged", - "description": "Issued when the target starts or stops needing BeginFrames.\nDeprecated. Issue beginFrame unconditionally instead and use result from\nbeginFrame to detect whether the frames were suppressed.", - "deprecated": true, - "parameters": [ - { - "name": "needsBeginFrames", - "description": "True if BeginFrames are needed, false otherwise.", - "type": "boolean" - } - ] + "description": "Enables headless events for the target.", + "deprecated": true } ] }, @@ -13807,6 +13846,12 @@ "description": "The client security state set for the request.", "optional": true, "$ref": "ClientSecurityState" + }, + { + "name": "siteHasCookieInOtherPartition", + "description": "Whether the site has partitioned cookies stored in a partition different than the current one.", + "optional": true, + "type": "boolean" } ] }, @@ -15273,6 +15318,7 @@ "ch-width", "clipboard-read", "clipboard-write", + "compute-pressure", "cross-origin-isolated", "direct-sockets", "display-capture", @@ -16195,7 +16241,6 @@ "DedicatedWorkerOrWorklet", "OutstandingNetworkRequestOthers", "OutstandingIndexedDBTransaction", - "RequestedNotificationsPermission", "RequestedMIDIPermission", "RequestedAudioCapturePermission", "RequestedVideoCapturePermission", @@ -16226,6 +16271,7 @@ "OutstandingNetworkRequestDirectSocket", "InjectedJavascript", "InjectedStyleSheet", + "KeepaliveRequest", "Dummy", "ContentSecurityHandler", "ContentWebAuthenticationAPI", @@ -16324,8 +16370,6 @@ "Activated", "Destroyed", "LowEndDevice", - "CrossOriginRedirect", - "CrossOriginNavigation", "InvalidSchemeRedirect", "InvalidSchemeNavigation", "InProgressNavigation", @@ -16359,7 +16403,14 @@ "ActivatedBeforeStarted", "InactivePageRestriction", "StartFailed", - "TimeoutBackgrounded" + "TimeoutBackgrounded", + "CrossSiteRedirect", + "CrossSiteNavigation", + "SameSiteCrossOriginRedirect", + "SameSiteCrossOriginNavigation", + "SameSiteCrossOriginRedirectNotOptIn", + "SameSiteCrossOriginNavigationNotOptIn", + "ActivationNavigationParameterMismatch" ] } ], @@ -16458,6 +16509,13 @@ "experimental": true, "optional": true, "type": "boolean" + }, + { + "name": "optimizeForSpeed", + "description": "Optimize image encoding for speed, not for resulting size (defaults to false)", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -16641,6 +16699,24 @@ } ] }, + { + "name": "getAdScriptId", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "$ref": "FrameId" + } + ], + "returns": [ + { + "name": "adScriptId", + "description": "Identifies the bottom-most script which caused the frame to be labelled\nas an ad. Only sent if frame is labelled as an ad and id is available.", + "optional": true, + "$ref": "AdScriptId" + } + ] + }, { "name": "getCookies", "description": "Returns all browser cookies for the page and all of its subframes. Depending\non the backend support, will return detailed cookie information in the\n`cookies` field.", @@ -17585,13 +17661,6 @@ "description": "JavaScript stack trace of when frame was attached, only set if frame initiated from script.", "optional": true, "$ref": "Runtime.StackTrace" - }, - { - "name": "adScriptId", - "description": "Identifies the bottom-most script which caused the frame to be labelled\nas an ad. Only sent if frame is labelled as an ad and id is available.", - "experimental": true, - "optional": true, - "$ref": "AdScriptId" } ] }, @@ -19056,6 +19125,7 @@ "service_workers", "cache_storage", "interest_groups", + "shared_storage", "all", "other" ] @@ -19189,6 +19259,150 @@ } } ] + }, + { + "id": "SharedStorageAccessType", + "description": "Enum of shared storage access types.", + "type": "string", + "enum": [ + "documentAddModule", + "documentSelectURL", + "documentRun", + "documentSet", + "documentAppend", + "documentDelete", + "documentClear", + "workletSet", + "workletAppend", + "workletDelete", + "workletClear", + "workletGet", + "workletKeys", + "workletEntries", + "workletLength", + "workletRemainingBudget" + ] + }, + { + "id": "SharedStorageEntry", + "description": "Struct for a single key-value pair in an origin's shared storage.", + "type": "object", + "properties": [ + { + "name": "key", + "type": "string" + }, + { + "name": "value", + "type": "string" + } + ] + }, + { + "id": "SharedStorageMetadata", + "description": "Details for an origin's shared storage.", + "type": "object", + "properties": [ + { + "name": "creationTime", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "length", + "type": "integer" + }, + { + "name": "remainingBudget", + "type": "number" + } + ] + }, + { + "id": "SharedStorageReportingMetadata", + "description": "Pair of reporting metadata details for a candidate URL for `selectURL()`.", + "type": "object", + "properties": [ + { + "name": "eventType", + "type": "string" + }, + { + "name": "reportingUrl", + "type": "string" + } + ] + }, + { + "id": "SharedStorageUrlWithMetadata", + "description": "Bundles a candidate URL with its reporting metadata.", + "type": "object", + "properties": [ + { + "name": "url", + "description": "Spec of candidate URL.", + "type": "string" + }, + { + "name": "reportingMetadata", + "description": "Any associated reporting metadata.", + "type": "array", + "items": { + "$ref": "SharedStorageReportingMetadata" + } + } + ] + }, + { + "id": "SharedStorageAccessParams", + "description": "Bundles the parameters for shared storage access events whose\npresence/absence can vary according to SharedStorageAccessType.", + "type": "object", + "properties": [ + { + "name": "scriptSourceUrl", + "description": "Spec of the module script URL.\nPresent only for SharedStorageAccessType.documentAddModule.", + "optional": true, + "type": "string" + }, + { + "name": "operationName", + "description": "Name of the registered operation to be run.\nPresent only for SharedStorageAccessType.documentRun and\nSharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "string" + }, + { + "name": "serializedData", + "description": "The operation's serialized data in bytes (converted to a string).\nPresent only for SharedStorageAccessType.documentRun and\nSharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "string" + }, + { + "name": "urlsWithMetadata", + "description": "Array of candidate URLs' specs, along with any associated metadata.\nPresent only for SharedStorageAccessType.documentSelectURL.", + "optional": true, + "type": "array", + "items": { + "$ref": "SharedStorageUrlWithMetadata" + } + }, + { + "name": "key", + "description": "Key for a specific entry in an origin's shared storage.\nPresent only for SharedStorageAccessType.documentSet,\nSharedStorageAccessType.documentAppend,\nSharedStorageAccessType.documentDelete,\nSharedStorageAccessType.workletSet,\nSharedStorageAccessType.workletAppend,\nSharedStorageAccessType.workletDelete, and\nSharedStorageAccessType.workletGet.", + "optional": true, + "type": "string" + }, + { + "name": "value", + "description": "Value for a specific entry in an origin's shared storage.\nPresent only for SharedStorageAccessType.documentSet,\nSharedStorageAccessType.documentAppend,\nSharedStorageAccessType.workletSet, and\nSharedStorageAccessType.workletAppend.", + "optional": true, + "type": "string" + }, + { + "name": "ignoreIfPresent", + "description": "Whether or not to set an entry for a key if that key is already present.\nPresent only for SharedStorageAccessType.documentSet and\nSharedStorageAccessType.workletSet.", + "optional": true, + "type": "boolean" + } + ] } ], "commands": [ @@ -19477,6 +19691,105 @@ "type": "boolean" } ] + }, + { + "name": "getSharedStorageMetadata", + "description": "Gets metadata for an origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + } + ], + "returns": [ + { + "name": "metadata", + "$ref": "SharedStorageMetadata" + } + ] + }, + { + "name": "getSharedStorageEntries", + "description": "Gets the entries in an given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + } + ], + "returns": [ + { + "name": "entries", + "type": "array", + "items": { + "$ref": "SharedStorageEntry" + } + } + ] + }, + { + "name": "setSharedStorageEntry", + "description": "Sets entry with `key` and `value` for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "value", + "type": "string" + }, + { + "name": "ignoreIfPresent", + "description": "If `ignoreIfPresent` is included and true, then only sets the entry if\n`key` doesn't already exist.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "name": "deleteSharedStorageEntry", + "description": "Deletes entry for `key` (if it exists) for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + }, + { + "name": "key", + "type": "string" + } + ] + }, + { + "name": "clearSharedStorageEntries", + "description": "Clears all entries for a given origin's shared storage.", + "experimental": true, + "parameters": [ + { + "name": "ownerOrigin", + "type": "string" + } + ] + }, + { + "name": "setSharedStorageTracking", + "description": "Enables/disables issuing of sharedStorageAccessed events.", + "experimental": true, + "parameters": [ + { + "name": "enable", + "type": "boolean" + } + ] } ], "events": [ @@ -19570,6 +19883,37 @@ "type": "string" } ] + }, + { + "name": "sharedStorageAccessed", + "description": "Shared storage was accessed by the associated page.\nThe following parameters are included in all events.", + "parameters": [ + { + "name": "accessTime", + "description": "Time of the access.", + "$ref": "Network.TimeSinceEpoch" + }, + { + "name": "type", + "description": "Enum value indicating the Shared Storage API method invoked.", + "$ref": "SharedStorageAccessType" + }, + { + "name": "mainFrameId", + "description": "DevTools Frame Token for the primary frame tree's root.", + "$ref": "Page.FrameId" + }, + { + "name": "ownerOrigin", + "description": "Serialized origin for the context that invoked the Shared Storage API.", + "type": "string" + }, + { + "name": "params", + "description": "The sub-parameters warapped by `params` are all optional and their\npresence/absence depends on `type`.", + "$ref": "SharedStorageAccessParams" + } + ] } ] }, @@ -21078,7 +21422,7 @@ }, { "name": "headers", - "description": "If set, overrides the request headers.", + "description": "If set, overrides the request headers. Note that the overrides do not\nextend to subsequent redirect hops, if a redirect happens. Another override\nmay be applied to a different request produced by a redirect.", "optional": true, "type": "array", "items": { @@ -21927,6 +22271,34 @@ } ] }, + { + "name": "setResponseOverrideBits", + "description": "Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.", + "parameters": [ + { + "name": "authenticatorId", + "$ref": "AuthenticatorId" + }, + { + "name": "isBogusSignature", + "description": "If isBogusSignature is set, overrides the signature in the authenticator response to be zero.\nDefaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "isBadUV", + "description": "If isBadUV is set, overrides the UV bit in the flags in the authenticator response to\nbe zero. Defaults to false.", + "optional": true, + "type": "boolean" + }, + { + "name": "isBadUP", + "description": "If isBadUP is set, overrides the UP bit in the flags in the authenticator response to\nbe zero. Defaults to false.", + "optional": true, + "type": "boolean" + } + ] + }, { "name": "removeVirtualAuthenticator", "description": "Removes the given authenticator.", @@ -23221,7 +23593,7 @@ }, { "name": "setPauseOnExceptions", - "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or\nno exceptions. Initial pause on exceptions state is `none`.", + "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,\nor caught exceptions, no exceptions. Initial pause on exceptions state is `none`.", "parameters": [ { "name": "state", @@ -23229,6 +23601,7 @@ "type": "string", "enum": [ "none", + "caught", "uncaught", "all" ] @@ -24227,66 +24600,6 @@ } } ] - }, - { - "id": "TypeObject", - "description": "Describes a type collected during runtime.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "name", - "description": "Name of a type collected with type profiling.", - "type": "string" - } - ] - }, - { - "id": "TypeProfileEntry", - "description": "Source offset and types for a parameter or return value.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "offset", - "description": "Source offset of the parameter or end of function for return values.", - "type": "integer" - }, - { - "name": "types", - "description": "The types for this parameter or return value.", - "type": "array", - "items": { - "$ref": "TypeObject" - } - } - ] - }, - { - "id": "ScriptTypeProfile", - "description": "Type profile data collected during runtime for a JavaScript script.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "scriptId", - "description": "JavaScript script id.", - "$ref": "Runtime.ScriptId" - }, - { - "name": "url", - "description": "JavaScript script name or url.", - "type": "string" - }, - { - "name": "entries", - "description": "Type profile entries for parameters and return values of the functions in the script.", - "type": "array", - "items": { - "$ref": "TypeProfileEntry" - } - } - ] } ], "commands": [ @@ -24355,11 +24668,6 @@ } ] }, - { - "name": "startTypeProfile", - "description": "Enable type profile.", - "experimental": true - }, { "name": "stop", "returns": [ @@ -24374,11 +24682,6 @@ "name": "stopPreciseCoverage", "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows\nexecuting optimized code." }, - { - "name": "stopTypeProfile", - "description": "Disable type profile. Disabling releases type profile data collected so far.", - "experimental": true - }, { "name": "takePreciseCoverage", "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code\ncoverage needs to have started.", @@ -24397,21 +24700,6 @@ "type": "number" } ] - }, - { - "name": "takeTypeProfile", - "description": "Collect type profile.", - "experimental": true, - "returns": [ - { - "name": "result", - "description": "Type profile for all scripts since startTypeProfile() was turned on.", - "type": "array", - "items": { - "$ref": "ScriptTypeProfile" - } - } - ] } ], "events": [