diff --git a/cdp/__init__.py b/cdp/__init__.py index e29a12e..d4b8452 100644 --- a/cdp/__init__.py +++ b/cdp/__init__.py @@ -52,6 +52,7 @@ import cdp.schema import cdp.security import cdp.service_worker +import cdp.smart_card_emulation import cdp.storage import cdp.system_info import cdp.target @@ -59,3 +60,4 @@ import cdp.tracing import cdp.web_audio import cdp.web_authn +import cdp.web_mcp diff --git a/cdp/audits.py b/cdp/audits.py index 5697995..beecbcd 100644 --- a/cdp/audits.py +++ b/cdp/audits.py @@ -94,8 +94,6 @@ class CookieExclusionReason(enum.Enum): EXCLUDE_SAME_SITE_NONE_INSECURE = "ExcludeSameSiteNoneInsecure" EXCLUDE_SAME_SITE_LAX = "ExcludeSameSiteLax" EXCLUDE_SAME_SITE_STRICT = "ExcludeSameSiteStrict" - EXCLUDE_INVALID_SAME_PARTY = "ExcludeInvalidSameParty" - EXCLUDE_SAME_PARTY_CROSS_PARTY_CONTEXT = "ExcludeSamePartyCrossPartyContext" EXCLUDE_DOMAIN_NON_ASCII = "ExcludeDomainNonASCII" EXCLUDE_THIRD_PARTY_COOKIE_BLOCKED_IN_FIRST_PARTY_SET = "ExcludeThirdPartyCookieBlockedInFirstPartySet" EXCLUDE_THIRD_PARTY_PHASEOUT = "ExcludeThirdPartyPhaseout" @@ -253,6 +251,41 @@ def from_json(cls, json: T_JSON_DICT) -> CookieIssueDetails: ) +class PerformanceIssueType(enum.Enum): + DOCUMENT_COOKIE = "DocumentCookie" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> PerformanceIssueType: + return cls(json) + + +@dataclass +class PerformanceIssueDetails: + r''' + Details for a performance issue. + ''' + performance_issue_type: PerformanceIssueType + + source_code_location: typing.Optional[SourceCodeLocation] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['performanceIssueType'] = self.performance_issue_type.to_json() + if self.source_code_location is not None: + json['sourceCodeLocation'] = self.source_code_location.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PerformanceIssueDetails: + return cls( + performance_issue_type=PerformanceIssueType.from_json(json['performanceIssueType']), + source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']) if 'sourceCodeLocation' in json else None, + ) + + class MixedContentResolutionStatus(enum.Enum): MIXED_CONTENT_BLOCKED = "MixedContentBlocked" MIXED_CONTENT_AUTOMATICALLY_UPGRADED = "MixedContentAutomaticallyUpgraded" @@ -595,46 +628,6 @@ def from_json(cls, json: T_JSON_DICT) -> SharedArrayBufferIssueDetails: ) -@dataclass -class LowTextContrastIssueDetails: - violating_node_id: dom.BackendNodeId - - violating_node_selector: str - - contrast_ratio: float - - threshold_aa: float - - threshold_aaa: float - - font_size: str - - font_weight: str - - def to_json(self) -> T_JSON_DICT: - json: T_JSON_DICT = dict() - json['violatingNodeId'] = self.violating_node_id.to_json() - json['violatingNodeSelector'] = self.violating_node_selector - json['contrastRatio'] = self.contrast_ratio - json['thresholdAA'] = self.threshold_aa - json['thresholdAAA'] = self.threshold_aaa - json['fontSize'] = self.font_size - json['fontWeight'] = self.font_weight - return json - - @classmethod - def from_json(cls, json: T_JSON_DICT) -> LowTextContrastIssueDetails: - return cls( - violating_node_id=dom.BackendNodeId.from_json(json['violatingNodeId']), - violating_node_selector=str(json['violatingNodeSelector']), - contrast_ratio=float(json['contrastRatio']), - threshold_aa=float(json['thresholdAA']), - threshold_aaa=float(json['thresholdAAA']), - font_size=str(json['fontSize']), - font_weight=str(json['fontWeight']), - ) - - @dataclass class CorsIssueDetails: r''' @@ -794,6 +787,22 @@ def from_json(cls, json: str) -> UnencodedDigestError: return cls(json) +class ConnectionAllowlistError(enum.Enum): + INVALID_HEADER = "InvalidHeader" + MORE_THAN_ONE_LIST = "MoreThanOneList" + ITEM_NOT_INNER_LIST = "ItemNotInnerList" + INVALID_ALLOWLIST_ITEM_TYPE = "InvalidAllowlistItemType" + REPORTING_ENDPOINT_NOT_TOKEN = "ReportingEndpointNotToken" + INVALID_URL_PATTERN = "InvalidUrlPattern" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> ConnectionAllowlistError: + return cls(json) + + @dataclass class AttributionReportingIssueDetails: r''' @@ -956,18 +965,43 @@ def from_json(cls, json: T_JSON_DICT) -> UnencodedDigestIssueDetails: ) +@dataclass +class ConnectionAllowlistIssueDetails: + error: ConnectionAllowlistError + + request: AffectedRequest + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['error'] = self.error.to_json() + json['request'] = self.request.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConnectionAllowlistIssueDetails: + return cls( + error=ConnectionAllowlistError.from_json(json['error']), + request=AffectedRequest.from_json(json['request']), + ) + + class GenericIssueErrorType(enum.Enum): FORM_LABEL_FOR_NAME_ERROR = "FormLabelForNameError" FORM_DUPLICATE_ID_FOR_INPUT_ERROR = "FormDuplicateIdForInputError" FORM_INPUT_WITH_NO_LABEL_ERROR = "FormInputWithNoLabelError" FORM_AUTOCOMPLETE_ATTRIBUTE_EMPTY_ERROR = "FormAutocompleteAttributeEmptyError" FORM_EMPTY_ID_AND_NAME_ATTRIBUTES_FOR_INPUT_ERROR = "FormEmptyIdAndNameAttributesForInputError" - FORM_ARIA_LABELLED_BY_TO_NON_EXISTING_ID = "FormAriaLabelledByToNonExistingId" + FORM_ARIA_LABELLED_BY_TO_NON_EXISTING_ID_ERROR = "FormAriaLabelledByToNonExistingIdError" FORM_INPUT_ASSIGNED_AUTOCOMPLETE_VALUE_TO_ID_OR_NAME_ATTRIBUTE_ERROR = "FormInputAssignedAutocompleteValueToIdOrNameAttributeError" - FORM_LABEL_HAS_NEITHER_FOR_NOR_NESTED_INPUT = "FormLabelHasNeitherForNorNestedInput" + FORM_LABEL_HAS_NEITHER_FOR_NOR_NESTED_INPUT_ERROR = "FormLabelHasNeitherForNorNestedInputError" FORM_LABEL_FOR_MATCHES_NON_EXISTING_ID_ERROR = "FormLabelForMatchesNonExistingIdError" FORM_INPUT_HAS_WRONG_BUT_WELL_INTENDED_AUTOCOMPLETE_VALUE_ERROR = "FormInputHasWrongButWellIntendedAutocompleteValueError" RESPONSE_WAS_BLOCKED_BY_ORB = "ResponseWasBlockedByORB" + NAVIGATION_ENTRY_MARKED_SKIPPABLE = "NavigationEntryMarkedSkippable" + AUTOFILL_AND_MANUAL_TEXT_POLICY_CONTROLLED_FEATURES_INFO = "AutofillAndManualTextPolicyControlledFeaturesInfo" + AUTOFILL_POLICY_CONTROLLED_FEATURE_INFO = "AutofillPolicyControlledFeatureInfo" + MANUAL_TEXT_POLICY_CONTROLLED_FEATURE_INFO = "ManualTextPolicyControlledFeatureInfo" + FORM_MODEL_CONTEXT_PARAMETER_MISSING_TITLE_AND_DESCRIPTION = "FormModelContextParameterMissingTitleAndDescription" def to_json(self) -> str: return self.value @@ -1153,10 +1187,6 @@ class FederatedAuthRequestIssueReason(enum.Enum): CONFIG_NO_RESPONSE = "ConfigNoResponse" CONFIG_INVALID_RESPONSE = "ConfigInvalidResponse" CONFIG_INVALID_CONTENT_TYPE = "ConfigInvalidContentType" - CLIENT_METADATA_HTTP_NOT_FOUND = "ClientMetadataHttpNotFound" - CLIENT_METADATA_NO_RESPONSE = "ClientMetadataNoResponse" - CLIENT_METADATA_INVALID_RESPONSE = "ClientMetadataInvalidResponse" - CLIENT_METADATA_INVALID_CONTENT_TYPE = "ClientMetadataInvalidContentType" IDP_NOT_POTENTIALLY_TRUSTWORTHY = "IdpNotPotentiallyTrustworthy" DISABLED_IN_SETTINGS = "DisabledInSettings" DISABLED_IN_FLAGS = "DisabledInFlags" @@ -1178,11 +1208,9 @@ class FederatedAuthRequestIssueReason(enum.Enum): CANCELED = "Canceled" RP_PAGE_NOT_VISIBLE = "RpPageNotVisible" SILENT_MEDIATION_FAILURE = "SilentMediationFailure" - THIRD_PARTY_COOKIES_BLOCKED = "ThirdPartyCookiesBlocked" NOT_SIGNED_IN_WITH_IDP = "NotSignedInWithIdp" MISSING_TRANSIENT_USER_ACTIVATION = "MissingTransientUserActivation" REPLACED_BY_ACTIVE_MODE = "ReplacedByActiveMode" - INVALID_FIELDS_SPECIFIED = "InvalidFieldsSpecified" RELYING_PARTY_ORIGIN_IS_OPAQUE = "RelyingPartyOriginIsOpaque" TYPE_NOT_MATCHING = "TypeNotMatching" UI_DISMISSED_NO_EMBARGO = "UiDismissedNoEmbargo" @@ -1499,6 +1527,131 @@ def from_json(cls, json: T_JSON_DICT) -> UserReidentificationIssueDetails: ) +class PermissionElementIssueType(enum.Enum): + INVALID_TYPE = "InvalidType" + FENCED_FRAME_DISALLOWED = "FencedFrameDisallowed" + CSP_FRAME_ANCESTORS_MISSING = "CspFrameAncestorsMissing" + PERMISSIONS_POLICY_BLOCKED = "PermissionsPolicyBlocked" + PADDING_RIGHT_UNSUPPORTED = "PaddingRightUnsupported" + PADDING_BOTTOM_UNSUPPORTED = "PaddingBottomUnsupported" + INSET_BOX_SHADOW_UNSUPPORTED = "InsetBoxShadowUnsupported" + REQUEST_IN_PROGRESS = "RequestInProgress" + UNTRUSTED_EVENT = "UntrustedEvent" + REGISTRATION_FAILED = "RegistrationFailed" + TYPE_NOT_SUPPORTED = "TypeNotSupported" + INVALID_TYPE_ACTIVATION = "InvalidTypeActivation" + SECURITY_CHECKS_FAILED = "SecurityChecksFailed" + ACTIVATION_DISABLED = "ActivationDisabled" + GEOLOCATION_DEPRECATED = "GeolocationDeprecated" + INVALID_DISPLAY_STYLE = "InvalidDisplayStyle" + NON_OPAQUE_COLOR = "NonOpaqueColor" + LOW_CONTRAST = "LowContrast" + FONT_SIZE_TOO_SMALL = "FontSizeTooSmall" + FONT_SIZE_TOO_LARGE = "FontSizeTooLarge" + INVALID_SIZE_VALUE = "InvalidSizeValue" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> PermissionElementIssueType: + return cls(json) + + +@dataclass +class PermissionElementIssueDetails: + r''' + This issue warns about improper usage of the element. + ''' + issue_type: PermissionElementIssueType + + #: The value of the type attribute. + type_: typing.Optional[str] = None + + #: The node ID of the element. + node_id: typing.Optional[dom.BackendNodeId] = None + + #: True if the issue is a warning, false if it is an error. + is_warning: typing.Optional[bool] = None + + #: Fields for message construction: + #: Used for messages that reference a specific permission name + permission_name: typing.Optional[str] = None + + #: Used for messages about occlusion + occluder_node_info: typing.Optional[str] = None + + #: Used for messages about occluder's parent + occluder_parent_node_info: typing.Optional[str] = None + + #: Used for messages about activation disabled reason + disable_reason: typing.Optional[str] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['issueType'] = self.issue_type.to_json() + if self.type_ is not None: + json['type'] = self.type_ + if self.node_id is not None: + json['nodeId'] = self.node_id.to_json() + if self.is_warning is not None: + json['isWarning'] = self.is_warning + if self.permission_name is not None: + json['permissionName'] = self.permission_name + if self.occluder_node_info is not None: + json['occluderNodeInfo'] = self.occluder_node_info + if self.occluder_parent_node_info is not None: + json['occluderParentNodeInfo'] = self.occluder_parent_node_info + if self.disable_reason is not None: + json['disableReason'] = self.disable_reason + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PermissionElementIssueDetails: + return cls( + issue_type=PermissionElementIssueType.from_json(json['issueType']), + type_=str(json['type']) if 'type' in json else None, + node_id=dom.BackendNodeId.from_json(json['nodeId']) if 'nodeId' in json else None, + is_warning=bool(json['isWarning']) if 'isWarning' in json else None, + permission_name=str(json['permissionName']) if 'permissionName' in json else None, + occluder_node_info=str(json['occluderNodeInfo']) if 'occluderNodeInfo' in json else None, + occluder_parent_node_info=str(json['occluderParentNodeInfo']) if 'occluderParentNodeInfo' in json else None, + disable_reason=str(json['disableReason']) if 'disableReason' in json else None, + ) + + +@dataclass +class SelectivePermissionsInterventionIssueDetails: + r''' + The issue warns about blocked calls to privacy sensitive APIs via the + Selective Permissions Intervention. + ''' + #: Which API was intervened on. + api_name: str + + #: Why the ad script using the API is considered an ad. + ad_ancestry: network.AdAncestry + + #: The stack trace at the time of the intervention. + stack_trace: typing.Optional[runtime.StackTrace] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['apiName'] = self.api_name + json['adAncestry'] = self.ad_ancestry.to_json() + if self.stack_trace is not None: + json['stackTrace'] = self.stack_trace.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SelectivePermissionsInterventionIssueDetails: + return cls( + api_name=str(json['apiName']), + ad_ancestry=network.AdAncestry.from_json(json['adAncestry']), + stack_trace=runtime.StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + ) + + class InspectorIssueCode(enum.Enum): r''' A unique identifier for the type of issue. Each type may use one of the @@ -1511,7 +1664,6 @@ class InspectorIssueCode(enum.Enum): HEAVY_AD_ISSUE = "HeavyAdIssue" CONTENT_SECURITY_POLICY_ISSUE = "ContentSecurityPolicyIssue" SHARED_ARRAY_BUFFER_ISSUE = "SharedArrayBufferIssue" - LOW_TEXT_CONTRAST_ISSUE = "LowTextContrastIssue" CORS_ISSUE = "CorsIssue" ATTRIBUTION_REPORTING_ISSUE = "AttributionReportingIssue" QUIRKS_MODE_ISSUE = "QuirksModeIssue" @@ -1530,7 +1682,11 @@ class InspectorIssueCode(enum.Enum): ELEMENT_ACCESSIBILITY_ISSUE = "ElementAccessibilityIssue" SRI_MESSAGE_SIGNATURE_ISSUE = "SRIMessageSignatureIssue" UNENCODED_DIGEST_ISSUE = "UnencodedDigestIssue" + CONNECTION_ALLOWLIST_ISSUE = "ConnectionAllowlistIssue" USER_REIDENTIFICATION_ISSUE = "UserReidentificationIssue" + PERMISSION_ELEMENT_ISSUE = "PermissionElementIssue" + PERFORMANCE_ISSUE = "PerformanceIssue" + SELECTIVE_PERMISSIONS_INTERVENTION_ISSUE = "SelectivePermissionsInterventionIssue" def to_json(self) -> str: return self.value @@ -1559,8 +1715,6 @@ class InspectorIssueDetails: shared_array_buffer_issue_details: typing.Optional[SharedArrayBufferIssueDetails] = None - low_text_contrast_issue_details: typing.Optional[LowTextContrastIssueDetails] = None - cors_issue_details: typing.Optional[CorsIssueDetails] = None attribution_reporting_issue_details: typing.Optional[AttributionReportingIssueDetails] = None @@ -1597,8 +1751,16 @@ class InspectorIssueDetails: unencoded_digest_issue_details: typing.Optional[UnencodedDigestIssueDetails] = None + connection_allowlist_issue_details: typing.Optional[ConnectionAllowlistIssueDetails] = None + user_reidentification_issue_details: typing.Optional[UserReidentificationIssueDetails] = None + permission_element_issue_details: typing.Optional[PermissionElementIssueDetails] = None + + performance_issue_details: typing.Optional[PerformanceIssueDetails] = None + + selective_permissions_intervention_issue_details: typing.Optional[SelectivePermissionsInterventionIssueDetails] = None + def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() if self.cookie_issue_details is not None: @@ -1613,8 +1775,6 @@ def to_json(self) -> T_JSON_DICT: json['contentSecurityPolicyIssueDetails'] = self.content_security_policy_issue_details.to_json() if self.shared_array_buffer_issue_details is not None: json['sharedArrayBufferIssueDetails'] = self.shared_array_buffer_issue_details.to_json() - if self.low_text_contrast_issue_details is not None: - json['lowTextContrastIssueDetails'] = self.low_text_contrast_issue_details.to_json() if self.cors_issue_details is not None: json['corsIssueDetails'] = self.cors_issue_details.to_json() if self.attribution_reporting_issue_details is not None: @@ -1651,8 +1811,16 @@ def to_json(self) -> T_JSON_DICT: json['sriMessageSignatureIssueDetails'] = self.sri_message_signature_issue_details.to_json() if self.unencoded_digest_issue_details is not None: json['unencodedDigestIssueDetails'] = self.unencoded_digest_issue_details.to_json() + if self.connection_allowlist_issue_details is not None: + json['connectionAllowlistIssueDetails'] = self.connection_allowlist_issue_details.to_json() if self.user_reidentification_issue_details is not None: json['userReidentificationIssueDetails'] = self.user_reidentification_issue_details.to_json() + if self.permission_element_issue_details is not None: + json['permissionElementIssueDetails'] = self.permission_element_issue_details.to_json() + if self.performance_issue_details is not None: + json['performanceIssueDetails'] = self.performance_issue_details.to_json() + if self.selective_permissions_intervention_issue_details is not None: + json['selectivePermissionsInterventionIssueDetails'] = self.selective_permissions_intervention_issue_details.to_json() return json @classmethod @@ -1664,7 +1832,6 @@ def from_json(cls, json: T_JSON_DICT) -> InspectorIssueDetails: heavy_ad_issue_details=HeavyAdIssueDetails.from_json(json['heavyAdIssueDetails']) if 'heavyAdIssueDetails' in json else None, content_security_policy_issue_details=ContentSecurityPolicyIssueDetails.from_json(json['contentSecurityPolicyIssueDetails']) if 'contentSecurityPolicyIssueDetails' in json else None, shared_array_buffer_issue_details=SharedArrayBufferIssueDetails.from_json(json['sharedArrayBufferIssueDetails']) if 'sharedArrayBufferIssueDetails' in json else None, - low_text_contrast_issue_details=LowTextContrastIssueDetails.from_json(json['lowTextContrastIssueDetails']) if 'lowTextContrastIssueDetails' in json else None, cors_issue_details=CorsIssueDetails.from_json(json['corsIssueDetails']) if 'corsIssueDetails' in json else None, attribution_reporting_issue_details=AttributionReportingIssueDetails.from_json(json['attributionReportingIssueDetails']) if 'attributionReportingIssueDetails' in json else None, quirks_mode_issue_details=QuirksModeIssueDetails.from_json(json['quirksModeIssueDetails']) if 'quirksModeIssueDetails' in json else None, @@ -1683,7 +1850,11 @@ def from_json(cls, json: T_JSON_DICT) -> InspectorIssueDetails: element_accessibility_issue_details=ElementAccessibilityIssueDetails.from_json(json['elementAccessibilityIssueDetails']) if 'elementAccessibilityIssueDetails' in json else None, sri_message_signature_issue_details=SRIMessageSignatureIssueDetails.from_json(json['sriMessageSignatureIssueDetails']) if 'sriMessageSignatureIssueDetails' in json else None, unencoded_digest_issue_details=UnencodedDigestIssueDetails.from_json(json['unencodedDigestIssueDetails']) if 'unencodedDigestIssueDetails' in json else None, + connection_allowlist_issue_details=ConnectionAllowlistIssueDetails.from_json(json['connectionAllowlistIssueDetails']) if 'connectionAllowlistIssueDetails' in json else None, user_reidentification_issue_details=UserReidentificationIssueDetails.from_json(json['userReidentificationIssueDetails']) if 'userReidentificationIssueDetails' in json else None, + permission_element_issue_details=PermissionElementIssueDetails.from_json(json['permissionElementIssueDetails']) if 'permissionElementIssueDetails' in json else None, + performance_issue_details=PerformanceIssueDetails.from_json(json['performanceIssueDetails']) if 'performanceIssueDetails' in json else None, + selective_permissions_intervention_issue_details=SelectivePermissionsInterventionIssueDetails.from_json(json['selectivePermissionsInterventionIssueDetails']) if 'selectivePermissionsInterventionIssueDetails' in json else None, ) @@ -1793,25 +1964,6 @@ def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: json = yield cmd_dict -def check_contrast( - report_aaa: typing.Optional[bool] = None - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: - r''' - Runs the contrast check for the target page. Found issues are reported - using Audits.issueAdded event. - - :param report_aaa: *(Optional)* Whether to report WCAG AAA level issues. Default is false. - ''' - params: T_JSON_DICT = dict() - if report_aaa is not None: - params['reportAAA'] = report_aaa - cmd_dict: T_JSON_DICT = { - 'method': 'Audits.checkContrast', - 'params': params, - } - json = yield cmd_dict - - def check_forms_issues() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[GenericIssueDetails]]: r''' Runs the form issues check for the target page. Found issues are reported diff --git a/cdp/browser.py b/cdp/browser.py index 7f56754..737d6a7 100644 --- a/cdp/browser.py +++ b/cdp/browser.py @@ -119,7 +119,9 @@ class PermissionType(enum.Enum): IDLE_DETECTION = "idleDetection" KEYBOARD_LOCK = "keyboardLock" LOCAL_FONTS = "localFonts" + LOCAL_NETWORK = "localNetwork" LOCAL_NETWORK_ACCESS = "localNetworkAccess" + LOOPBACK_NETWORK = "loopbackNetwork" MIDI = "midi" MIDI_SYSEX = "midiSysex" NFC = "nfc" diff --git a/cdp/css.py b/cdp/css.py index 1886a3c..0f599da 100644 --- a/cdp/css.py +++ b/cdp/css.py @@ -15,18 +15,6 @@ from . import page -class StyleSheetId(str): - def to_json(self) -> str: - return self - - @classmethod - def from_json(cls, json: str) -> StyleSheetId: - return cls(json) - - def __repr__(self): - return 'StyleSheetId({})'.format(super().__repr__()) - - class StyleSheetOrigin(enum.Enum): r''' Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent @@ -296,7 +284,7 @@ class CSSStyleSheetHeader: CSS stylesheet metainformation. ''' #: The stylesheet identifier. - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId #: Owner frame identifier. frame_id: page.FrameId @@ -385,7 +373,7 @@ def to_json(self) -> T_JSON_DICT: @classmethod def from_json(cls, json: T_JSON_DICT) -> CSSStyleSheetHeader: return cls( - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']), + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']), frame_id=page.FrameId.from_json(json['frameId']), source_url=str(json['sourceURL']), origin=StyleSheetOrigin.from_json(json['origin']), @@ -422,7 +410,7 @@ class CSSRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None #: Array of selectors from ancestor style rules, sorted by distance from the current rule. nesting_selectors: typing.Optional[typing.List[str]] = None @@ -457,6 +445,10 @@ class CSSRule: #: The array enumerates @starting-style at-rules starting with the innermost one, going outwards. starting_styles: typing.Optional[typing.List[CSSStartingStyle]] = None + #: @navigation CSS at-rule array. + #: The array enumerates @navigation at-rules starting with the innermost one, going outwards. + navigations: typing.Optional[typing.List[CSSNavigation]] = None + def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() json['selectorList'] = self.selector_list.to_json() @@ -482,6 +474,8 @@ def to_json(self) -> T_JSON_DICT: json['ruleTypes'] = [i.to_json() for i in self.rule_types] if self.starting_styles is not None: json['startingStyles'] = [i.to_json() for i in self.starting_styles] + if self.navigations is not None: + json['navigations'] = [i.to_json() for i in self.navigations] return json @classmethod @@ -490,7 +484,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSRule: selector_list=SelectorList.from_json(json['selectorList']), origin=StyleSheetOrigin.from_json(json['origin']), style=CSSStyle.from_json(json['style']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, nesting_selectors=[str(i) for i in json['nestingSelectors']] if 'nestingSelectors' in json else None, origin_tree_scope_node_id=dom.BackendNodeId.from_json(json['originTreeScopeNodeId']) if 'originTreeScopeNodeId' in json else None, media=[CSSMedia.from_json(i) for i in json['media']] if 'media' in json else None, @@ -500,6 +494,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSRule: scopes=[CSSScope.from_json(i) for i in json['scopes']] if 'scopes' in json else None, rule_types=[CSSRuleType.from_json(i) for i in json['ruleTypes']] if 'ruleTypes' in json else None, starting_styles=[CSSStartingStyle.from_json(i) for i in json['startingStyles']] if 'startingStyles' in json else None, + navigations=[CSSNavigation.from_json(i) for i in json['navigations']] if 'navigations' in json else None, ) @@ -515,6 +510,7 @@ class CSSRuleType(enum.Enum): SCOPE_RULE = "ScopeRule" STYLE_RULE = "StyleRule" STARTING_STYLE_RULE = "StartingStyleRule" + NAVIGATION_RULE = "NavigationRule" def to_json(self) -> str: return self.value @@ -531,7 +527,7 @@ class RuleUsage: ''' #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId #: Offset of the start of the rule (including selector) from the beginning of the stylesheet. start_offset: float @@ -553,7 +549,7 @@ def to_json(self) -> T_JSON_DICT: @classmethod def from_json(cls, json: T_JSON_DICT) -> RuleUsage: return cls( - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']), + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']), start_offset=float(json['startOffset']), end_offset=float(json['endOffset']), used=bool(json['used']), @@ -677,7 +673,7 @@ class CSSStyle: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None #: Style declaration text (if available). css_text: typing.Optional[str] = None @@ -702,7 +698,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSStyle: return cls( css_properties=[CSSProperty.from_json(i) for i in json['cssProperties']], shorthand_entries=[ShorthandEntry.from_json(i) for i in json['shorthandEntries']], - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, css_text=str(json['cssText']) if 'cssText' in json else None, range_=SourceRange.from_json(json['range']) if 'range' in json else None, ) @@ -798,7 +794,7 @@ class CSSMedia: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None #: Array of media queries. media_list: typing.Optional[typing.List[MediaQuery]] = None @@ -824,7 +820,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSMedia: source=str(json['source']), source_url=str(json['sourceURL']) if 'sourceURL' in json else None, range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, media_list=[MediaQuery.from_json(i) for i in json['mediaList']] if 'mediaList' in json else None, ) @@ -909,7 +905,7 @@ class CSSContainerQuery: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None #: Optional name for the container. name: typing.Optional[str] = None @@ -950,7 +946,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSContainerQuery: return cls( text=str(json['text']), range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, name=str(json['name']) if 'name' in json else None, physical_axes=dom.PhysicalAxes.from_json(json['physicalAxes']) if 'physicalAxes' in json else None, logical_axes=dom.LogicalAxes.from_json(json['logicalAxes']) if 'logicalAxes' in json else None, @@ -975,7 +971,7 @@ class CSSSupports: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -993,7 +989,46 @@ def from_json(cls, json: T_JSON_DICT) -> CSSSupports: text=str(json['text']), active=bool(json['active']), range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + ) + + +@dataclass +class CSSNavigation: + r''' + CSS Navigation at-rule descriptor. + ''' + #: Navigation rule text. + text: str + + #: Whether the navigation condition is satisfied. + active: typing.Optional[bool] = None + + #: The associated rule header range in the enclosing stylesheet (if + #: available). + range_: typing.Optional[SourceRange] = None + + #: Identifier of the stylesheet containing this object (if exists). + style_sheet_id: typing.Optional[dom.StyleSheetId] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['text'] = self.text + if self.active is not None: + json['active'] = self.active + if self.range_ is not None: + json['range'] = self.range_.to_json() + if self.style_sheet_id is not None: + json['styleSheetId'] = self.style_sheet_id.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CSSNavigation: + return cls( + text=str(json['text']), + active=bool(json['active']) if 'active' in json else None, + range_=SourceRange.from_json(json['range']) if 'range' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1010,7 +1045,7 @@ class CSSScope: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1026,7 +1061,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSScope: return cls( text=str(json['text']), range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1043,7 +1078,7 @@ class CSSLayer: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1059,7 +1094,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSLayer: return cls( text=str(json['text']), range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1073,7 +1108,7 @@ class CSSStartingStyle: range_: typing.Optional[SourceRange] = None #: Identifier of the stylesheet containing this object (if exists). - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1087,7 +1122,7 @@ def to_json(self) -> T_JSON_DICT: def from_json(cls, json: T_JSON_DICT) -> CSSStartingStyle: return cls( range_=SourceRange.from_json(json['range']) if 'range' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1278,7 +1313,7 @@ class CSSTryRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1293,7 +1328,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSTryRule: return cls( origin=StyleSheetOrigin.from_json(json['origin']), style=CSSStyle.from_json(json['style']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1315,7 +1350,7 @@ class CSSPositionTryRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1334,7 +1369,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSPositionTryRule: origin=StyleSheetOrigin.from_json(json['origin']), style=CSSStyle.from_json(json['style']), active=bool(json['active']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1395,43 +1430,6 @@ def from_json(cls, json: T_JSON_DICT) -> CSSPropertyRegistration: ) -@dataclass -class CSSFontPaletteValuesRule: - r''' - CSS font-palette-values rule representation. - ''' - #: Parent stylesheet's origin. - origin: StyleSheetOrigin - - #: Associated font palette name. - font_palette_name: Value - - #: Associated style declaration. - style: CSSStyle - - #: The css style sheet identifier (absent for user agent stylesheet and user-specified - #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None - - def to_json(self) -> T_JSON_DICT: - json: T_JSON_DICT = dict() - json['origin'] = self.origin.to_json() - json['fontPaletteName'] = self.font_palette_name.to_json() - json['style'] = self.style.to_json() - if self.style_sheet_id is not None: - json['styleSheetId'] = self.style_sheet_id.to_json() - return json - - @classmethod - def from_json(cls, json: T_JSON_DICT) -> CSSFontPaletteValuesRule: - return cls( - origin=StyleSheetOrigin.from_json(json['origin']), - font_palette_name=Value.from_json(json['fontPaletteName']), - style=CSSStyle.from_json(json['style']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, - ) - - @dataclass class CSSAtRule: r''' @@ -1455,7 +1453,7 @@ class CSSAtRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1478,7 +1476,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSAtRule: style=CSSStyle.from_json(json['style']), subsection=str(json['subsection']) if 'subsection' in json else None, name=Value.from_json(json['name']) if 'name' in json else None, - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1498,7 +1496,7 @@ class CSSPropertyRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1515,7 +1513,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSPropertyRule: origin=StyleSheetOrigin.from_json(json['origin']), property_name=Value.from_json(json['propertyName']), style=CSSStyle.from_json(json['style']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1564,6 +1562,9 @@ class CSSFunctionConditionNode: #: @supports CSS at-rule condition. Only one type of condition should be set. supports: typing.Optional[CSSSupports] = None + #: @navigation condition. Only one type of condition should be set. + navigation: typing.Optional[CSSNavigation] = None + def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() json['children'] = [i.to_json() for i in self.children] @@ -1574,6 +1575,8 @@ def to_json(self) -> T_JSON_DICT: json['containerQueries'] = self.container_queries.to_json() if self.supports is not None: json['supports'] = self.supports.to_json() + if self.navigation is not None: + json['navigation'] = self.navigation.to_json() return json @classmethod @@ -1584,6 +1587,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSFunctionConditionNode: media=CSSMedia.from_json(json['media']) if 'media' in json else None, container_queries=CSSContainerQuery.from_json(json['containerQueries']) if 'containerQueries' in json else None, supports=CSSSupports.from_json(json['supports']) if 'supports' in json else None, + navigation=CSSNavigation.from_json(json['navigation']) if 'navigation' in json else None, ) @@ -1633,7 +1637,7 @@ class CSSFunctionRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1652,7 +1656,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSFunctionRule: origin=StyleSheetOrigin.from_json(json['origin']), parameters=[CSSFunctionParameter.from_json(i) for i in json['parameters']], children=[CSSFunctionNode.from_json(i) for i in json['children']], - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1672,7 +1676,7 @@ class CSSKeyframeRule: #: The css style sheet identifier (absent for user agent stylesheet and user-specified #: stylesheet rules) this rule came from. - style_sheet_id: typing.Optional[StyleSheetId] = None + style_sheet_id: typing.Optional[dom.StyleSheetId] = None def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() @@ -1689,7 +1693,7 @@ def from_json(cls, json: T_JSON_DICT) -> CSSKeyframeRule: origin=StyleSheetOrigin.from_json(json['origin']), key_text=Value.from_json(json['keyText']), style=CSSStyle.from_json(json['style']), - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) if 'styleSheetId' in json else None, ) @@ -1699,7 +1703,7 @@ class StyleDeclarationEdit: A descriptor of operation to mutate style declaration text. ''' #: The css style sheet identifier. - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId #: The range of the style text in the enclosing stylesheet. range_: SourceRange @@ -1717,14 +1721,14 @@ def to_json(self) -> T_JSON_DICT: @classmethod def from_json(cls, json: T_JSON_DICT) -> StyleDeclarationEdit: return cls( - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']), + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']), range_=SourceRange.from_json(json['range']), text=str(json['text']), ) def add_rule( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, rule_text: str, location: SourceRange, node_for_property_syntax_validation: typing.Optional[dom.NodeId] = None @@ -1754,7 +1758,7 @@ def add_rule( def collect_class_names( - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: r''' Returns all class names from specified stylesheet. @@ -1775,7 +1779,7 @@ def collect_class_names( def create_style_sheet( frame_id: page.FrameId, force: typing.Optional[bool] = None - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,StyleSheetId]: + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,dom.StyleSheetId]: r''' Creates a new special "via-inspector" stylesheet in the frame with given ``frameId``. @@ -1792,7 +1796,7 @@ def create_style_sheet( 'params': params, } json = yield cmd_dict - return StyleSheetId.from_json(json['styleSheetId']) + return dom.StyleSheetId.from_json(json['styleSheetId']) def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: @@ -1924,6 +1928,8 @@ def resolve_values( to the provided property syntax, the value is parsed using combined syntax as if null ``propertyName`` was provided. If the value cannot be resolved even then, return the provided value without any changes. + Note: this function currently does not resolve CSS random() function, + it returns unmodified random() function parts.` **EXPERIMENTAL** @@ -2033,7 +2039,7 @@ def get_animated_styles_for_node( def get_matched_styles_for_node( node_id: dom.NodeId - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[CSSStyle], typing.Optional[CSSStyle], typing.Optional[typing.List[RuleMatch]], typing.Optional[typing.List[PseudoElementMatches]], typing.Optional[typing.List[InheritedStyleEntry]], typing.Optional[typing.List[InheritedPseudoElementMatches]], typing.Optional[typing.List[CSSKeyframesRule]], typing.Optional[typing.List[CSSPositionTryRule]], typing.Optional[int], typing.Optional[typing.List[CSSPropertyRule]], typing.Optional[typing.List[CSSPropertyRegistration]], typing.Optional[CSSFontPaletteValuesRule], typing.Optional[typing.List[CSSAtRule]], typing.Optional[dom.NodeId], typing.Optional[typing.List[CSSFunctionRule]]]]: + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[CSSStyle], typing.Optional[CSSStyle], typing.Optional[typing.List[RuleMatch]], typing.Optional[typing.List[PseudoElementMatches]], typing.Optional[typing.List[InheritedStyleEntry]], typing.Optional[typing.List[InheritedPseudoElementMatches]], typing.Optional[typing.List[CSSKeyframesRule]], typing.Optional[typing.List[CSSPositionTryRule]], typing.Optional[int], typing.Optional[typing.List[CSSPropertyRule]], typing.Optional[typing.List[CSSPropertyRegistration]], typing.Optional[typing.List[CSSAtRule]], typing.Optional[dom.NodeId], typing.Optional[typing.List[CSSFunctionRule]]]]: r''' Returns requested styles for a DOM node identified by ``nodeId``. @@ -2051,10 +2057,9 @@ def get_matched_styles_for_node( 8. **activePositionFallbackIndex** - *(Optional)* Index of the active fallback in the applied position-try-fallback property, will not be set if there is no active position-try fallback. 9. **cssPropertyRules** - *(Optional)* A list of CSS at-property rules matching this node. 10. **cssPropertyRegistrations** - *(Optional)* A list of CSS property registrations matching this node. - 11. **cssFontPaletteValuesRule** - *(Optional)* A font-palette-values rule matching this node. - 12. **cssAtRules** - *(Optional)* A list of simple @rules matching this node or its pseudo-elements. - 13. **parentLayoutNodeId** - *(Optional)* Id of the first parent element that does not have display: contents. - 14. **cssFunctionRules** - *(Optional)* A list of CSS at-function rules referenced by styles of this node. + 11. **cssAtRules** - *(Optional)* A list of simple @rules matching this node or its pseudo-elements. + 12. **parentLayoutNodeId** - *(Optional)* Id of the first parent element that does not have display: contents. + 13. **cssFunctionRules** - *(Optional)* A list of CSS at-function rules referenced by styles of this node. ''' params: T_JSON_DICT = dict() params['nodeId'] = node_id.to_json() @@ -2075,7 +2080,6 @@ def get_matched_styles_for_node( int(json['activePositionFallbackIndex']) if 'activePositionFallbackIndex' in json else None, [CSSPropertyRule.from_json(i) for i in json['cssPropertyRules']] if 'cssPropertyRules' in json else None, [CSSPropertyRegistration.from_json(i) for i in json['cssPropertyRegistrations']] if 'cssPropertyRegistrations' in json else None, - CSSFontPaletteValuesRule.from_json(json['cssFontPaletteValuesRule']) if 'cssFontPaletteValuesRule' in json else None, [CSSAtRule.from_json(i) for i in json['cssAtRules']] if 'cssAtRules' in json else None, dom.NodeId.from_json(json['parentLayoutNodeId']) if 'parentLayoutNodeId' in json else None, [CSSFunctionRule.from_json(i) for i in json['cssFunctionRules']] if 'cssFunctionRules' in json else None @@ -2131,7 +2135,7 @@ def get_platform_fonts_for_node( def get_style_sheet_text( - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: r''' Returns the current textual content for a stylesheet. @@ -2174,7 +2178,7 @@ def get_layers_for_node( def get_location_for_selector( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, selector_text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[SourceRange]]: r''' @@ -2287,7 +2291,7 @@ def set_effective_property_value_for_node( def set_property_rule_property_name( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, property_name: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Value]: @@ -2312,7 +2316,7 @@ def set_property_rule_property_name( def set_keyframe_key( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, key_text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Value]: @@ -2337,7 +2341,7 @@ def set_keyframe_key( def set_media_text( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,CSSMedia]: @@ -2362,7 +2366,7 @@ def set_media_text( def set_container_query_text( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,CSSContainerQuery]: @@ -2389,7 +2393,7 @@ def set_container_query_text( def set_supports_text( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,CSSSupports]: @@ -2415,8 +2419,35 @@ def set_supports_text( return CSSSupports.from_json(json['supports']) +def set_navigation_text( + style_sheet_id: dom.StyleSheetId, + range_: SourceRange, + text: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,CSSNavigation]: + r''' + Modifies the expression of a navigation at-rule. + + **EXPERIMENTAL** + + :param style_sheet_id: + :param range_: + :param text: + :returns: The resulting CSS Navigation rule after modification. + ''' + params: T_JSON_DICT = dict() + params['styleSheetId'] = style_sheet_id.to_json() + params['range'] = range_.to_json() + params['text'] = text + cmd_dict: T_JSON_DICT = { + 'method': 'CSS.setNavigationText', + 'params': params, + } + json = yield cmd_dict + return CSSNavigation.from_json(json['navigation']) + + def set_scope_text( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,CSSScope]: @@ -2443,7 +2474,7 @@ def set_scope_text( def set_rule_selector( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, range_: SourceRange, selector: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SelectorList]: @@ -2468,7 +2499,7 @@ def set_rule_selector( def set_style_sheet_text( - style_sheet_id: StyleSheetId, + style_sheet_id: dom.StyleSheetId, text: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[str]]: r''' @@ -2630,12 +2661,12 @@ class StyleSheetChanged: r''' Fired whenever a stylesheet is changed as a result of the client operation. ''' - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId @classmethod def from_json(cls, json: T_JSON_DICT) -> StyleSheetChanged: return cls( - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) ) @@ -2646,12 +2677,12 @@ class StyleSheetRemoved: Fired whenever an active document stylesheet is removed. ''' #: Identifier of the removed stylesheet. - style_sheet_id: StyleSheetId + style_sheet_id: dom.StyleSheetId @classmethod def from_json(cls, json: T_JSON_DICT) -> StyleSheetRemoved: return cls( - style_sheet_id=StyleSheetId.from_json(json['styleSheetId']) + style_sheet_id=dom.StyleSheetId.from_json(json['styleSheetId']) ) diff --git a/cdp/dom.py b/cdp/dom.py index f368273..2d198b7 100644 --- a/cdp/dom.py +++ b/cdp/dom.py @@ -47,6 +47,21 @@ def __repr__(self): return 'BackendNodeId({})'.format(super().__repr__()) +class StyleSheetId(str): + r''' + Unique identifier for a CSS stylesheet. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> StyleSheetId: + return cls(json) + + def __repr__(self): + return 'StyleSheetId({})'.format(super().__repr__()) + + @dataclass class BackendNode: r''' @@ -120,7 +135,6 @@ class PseudoType(enum.Enum): PICKER = "picker" PERMISSION_ICON = "permission-icon" OVERSCROLL_AREA_PARENT = "overscroll-area-parent" - OVERSCROLL_CLIENT_AREA = "overscroll-client-area" def to_json(self) -> str: return self.value @@ -315,6 +329,10 @@ class Node: affected_by_starting_styles: typing.Optional[bool] = None + adopted_style_sheets: typing.Optional[typing.List[StyleSheetId]] = None + + is_ad_related: typing.Optional[bool] = None + def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() json['nodeId'] = self.node_id.to_json() @@ -377,6 +395,10 @@ def to_json(self) -> T_JSON_DICT: json['isScrollable'] = self.is_scrollable if self.affected_by_starting_styles is not None: json['affectedByStartingStyles'] = self.affected_by_starting_styles + if self.adopted_style_sheets is not None: + json['adoptedStyleSheets'] = [i.to_json() for i in self.adopted_style_sheets] + if self.is_ad_related is not None: + json['isAdRelated'] = self.is_ad_related return json @classmethod @@ -415,6 +437,8 @@ def from_json(cls, json: T_JSON_DICT) -> Node: assigned_slot=BackendNode.from_json(json['assignedSlot']) if 'assignedSlot' in json else None, is_scrollable=bool(json['isScrollable']) if 'isScrollable' in json else None, affected_by_starting_styles=bool(json['affectedByStartingStyles']) if 'affectedByStartingStyles' in json else None, + adopted_style_sheets=[StyleSheetId.from_json(i) for i in json['adoptedStyleSheets']] if 'adoptedStyleSheets' in json else None, + is_ad_related=bool(json['isAdRelated']) if 'isAdRelated' in json else None, ) @@ -1874,6 +1898,27 @@ def from_json(cls, json: T_JSON_DICT) -> AttributeModified: ) +@event_class('DOM.adoptedStyleSheetsModified') +@dataclass +class AdoptedStyleSheetsModified: + r''' + **EXPERIMENTAL** + + Fired when ``Element``'s adoptedStyleSheets are modified. + ''' + #: Id of the node that has changed. + node_id: NodeId + #: New adoptedStyleSheets array. + adopted_style_sheets: typing.List[StyleSheetId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AdoptedStyleSheetsModified: + return cls( + node_id=NodeId.from_json(json['nodeId']), + adopted_style_sheets=[StyleSheetId.from_json(i) for i in json['adoptedStyleSheets']] + ) + + @event_class('DOM.attributeRemoved') @dataclass class AttributeRemoved: @@ -2085,6 +2130,27 @@ def from_json(cls, json: T_JSON_DICT) -> ScrollableFlagUpdated: ) +@event_class('DOM.adRelatedStateUpdated') +@dataclass +class AdRelatedStateUpdated: + r''' + **EXPERIMENTAL** + + Fired when a node's ad related state changes. + ''' + #: The id of the node. + node_id: NodeId + #: If the node is ad related. + is_ad_related: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AdRelatedStateUpdated: + return cls( + node_id=NodeId.from_json(json['nodeId']), + is_ad_related=bool(json['isAdRelated']) + ) + + @event_class('DOM.affectedByStartingStylesFlagUpdated') @dataclass class AffectedByStartingStylesFlagUpdated: diff --git a/cdp/emulation.py b/cdp/emulation.py index bf1374a..365db16 100644 --- a/cdp/emulation.py +++ b/cdp/emulation.py @@ -616,6 +616,7 @@ class DisabledImageType(enum.Enum): Enum of image types that can be disabled. ''' AVIF = "avif" + JXL = "jxl" WEBP = "webp" def to_json(self) -> str: @@ -783,7 +784,9 @@ def set_device_metrics_override( screen_orientation: typing.Optional[ScreenOrientation] = None, viewport: typing.Optional[page.Viewport] = None, display_feature: typing.Optional[DisplayFeature] = None, - device_posture: typing.Optional[DevicePosture] = None + device_posture: typing.Optional[DevicePosture] = None, + scrollbar_type: typing.Optional[str] = None, + screen_orientation_lock_emulation: typing.Optional[bool] = None ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: r''' Overrides the values of device screen dimensions (window.screen.width, window.screen.height, @@ -804,6 +807,8 @@ def set_device_metrics_override( :param viewport: **(EXPERIMENTAL)** *(Optional)* If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions. :param display_feature: **(DEPRECATED)** **(EXPERIMENTAL)** *(Optional)* If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off. Deprecated, use Emulation.setDisplayFeaturesOverride. :param device_posture: **(DEPRECATED)** **(EXPERIMENTAL)** *(Optional)* If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride. + :param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ```default```. + :param screen_orientation_lock_emulation: **(EXPERIMENTAL)** *(Optional)* If set to true, enables screen orientation lock emulation, which intercepts screen.orientation.lock() calls from the page and reports orientation changes via screenOrientationLockChanged events. This is useful for emulating mobile device orientation lock behavior in responsive design mode. ''' params: T_JSON_DICT = dict() params['width'] = width @@ -830,6 +835,10 @@ def set_device_metrics_override( params['displayFeature'] = display_feature.to_json() if device_posture is not None: params['devicePosture'] = device_posture.to_json() + if scrollbar_type is not None: + params['scrollbarType'] = scrollbar_type + if screen_orientation_lock_emulation is not None: + params['screenOrientationLockEmulation'] = screen_orientation_lock_emulation cmd_dict: T_JSON_DICT = { 'method': 'Emulation.setDeviceMetricsOverride', 'params': params, @@ -1560,7 +1569,8 @@ def set_small_viewport_height_difference_override( def get_screen_infos() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ScreenInfo]]: r''' - Returns device's screen configuration. + Returns device's screen configuration. In headful mode, the physical screens configuration is returned, + whereas in headless mode, a virtual headless screen configuration is provided instead. **EXPERIMENTAL** @@ -1627,6 +1637,67 @@ def add_screen( return ScreenInfo.from_json(json['screenInfo']) +def update_screen( + screen_id: ScreenId, + left: typing.Optional[int] = None, + top: typing.Optional[int] = None, + width: typing.Optional[int] = None, + height: typing.Optional[int] = None, + work_area_insets: typing.Optional[WorkAreaInsets] = None, + device_pixel_ratio: typing.Optional[float] = None, + rotation: typing.Optional[int] = None, + color_depth: typing.Optional[int] = None, + label: typing.Optional[str] = None, + is_internal: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,ScreenInfo]: + r''' + Updates specified screen parameters. Only supported in headless mode. + + **EXPERIMENTAL** + + :param screen_id: Target screen identifier. + :param left: *(Optional)* Offset of the left edge of the screen in pixels. + :param top: *(Optional)* Offset of the top edge of the screen in pixels. + :param width: *(Optional)* The width of the screen in pixels. + :param height: *(Optional)* The height of the screen in pixels. + :param work_area_insets: *(Optional)* Specifies the screen's work area. + :param device_pixel_ratio: *(Optional)* Specifies the screen's device pixel ratio. + :param rotation: *(Optional)* Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. + :param color_depth: *(Optional)* Specifies the screen's color depth in bits. + :param label: *(Optional)* Specifies the descriptive label for the screen. + :param is_internal: *(Optional)* Indicates whether the screen is internal to the device or external, attached to the device. Default is false. + :returns: + ''' + params: T_JSON_DICT = dict() + params['screenId'] = screen_id.to_json() + if left is not None: + params['left'] = left + if top is not None: + params['top'] = top + if width is not None: + params['width'] = width + if height is not None: + params['height'] = height + if work_area_insets is not None: + params['workAreaInsets'] = work_area_insets.to_json() + if device_pixel_ratio is not None: + params['devicePixelRatio'] = device_pixel_ratio + if rotation is not None: + params['rotation'] = rotation + if color_depth is not None: + params['colorDepth'] = color_depth + if label is not None: + params['label'] = label + if is_internal is not None: + params['isInternal'] = is_internal + cmd_dict: T_JSON_DICT = { + 'method': 'Emulation.updateScreen', + 'params': params, + } + json = yield cmd_dict + return ScreenInfo.from_json(json['screenInfo']) + + def remove_screen( screen_id: ScreenId ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: @@ -1646,6 +1717,28 @@ def remove_screen( json = yield cmd_dict +def set_primary_screen( + screen_id: ScreenId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Set primary screen. Only supported in headless mode. + Note that this changes the coordinate system origin to the top-left + of the new primary screen, updating the bounds and work areas + of all existing screens accordingly. + + **EXPERIMENTAL** + + :param screen_id: + ''' + params: T_JSON_DICT = dict() + params['screenId'] = screen_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Emulation.setPrimaryScreen', + 'params': params, + } + json = yield cmd_dict + + @event_class('Emulation.virtualTimeBudgetExpired') @dataclass class VirtualTimeBudgetExpired: @@ -1661,3 +1754,26 @@ def from_json(cls, json: T_JSON_DICT) -> VirtualTimeBudgetExpired: return cls( ) + + +@event_class('Emulation.screenOrientationLockChanged') +@dataclass +class ScreenOrientationLockChanged: + r''' + **EXPERIMENTAL** + + Fired when a page calls screen.orientation.lock() or screen.orientation.unlock() + while device emulation is enabled. This allows the DevTools frontend to update the + emulated device orientation accordingly. + ''' + #: Whether the screen orientation is currently locked. + locked: bool + #: The orientation lock type requested by the page. Only set when locked is true. + orientation: typing.Optional[ScreenOrientation] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ScreenOrientationLockChanged: + return cls( + locked=bool(json['locked']), + orientation=ScreenOrientation.from_json(json['orientation']) if 'orientation' in json else None + ) diff --git a/cdp/extensions.py b/cdp/extensions.py index a202a31..bb76e23 100644 --- a/cdp/extensions.py +++ b/cdp/extensions.py @@ -29,8 +29,71 @@ def from_json(cls, json: str) -> StorageArea: return cls(json) +@dataclass +class ExtensionInfo: + r''' + Detailed information about an extension. + ''' + #: Extension id. + id_: str + + #: Extension name. + name: str + + #: Extension version. + version: str + + #: The path from which the extension was loaded. + path: str + + #: Extension enabled status. + enabled: bool + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['id'] = self.id_ + json['name'] = self.name + json['version'] = self.version + json['path'] = self.path + json['enabled'] = self.enabled + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExtensionInfo: + return cls( + id_=str(json['id']), + name=str(json['name']), + version=str(json['version']), + path=str(json['path']), + enabled=bool(json['enabled']), + ) + + +def trigger_action( + id_: str, + target_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Runs an extension default action. + Available if the client is connected using the --remote-debugging-pipe + flag and the --enable-unsafe-extension-debugging flag is set. + + :param id_: Extension id. + :param target_id: A tab target ID to trigger the default extension action on. + ''' + params: T_JSON_DICT = dict() + params['id'] = id_ + params['targetId'] = target_id + cmd_dict: T_JSON_DICT = { + 'method': 'Extensions.triggerAction', + 'params': params, + } + json = yield cmd_dict + + def load_unpacked( - path: str + path: str, + enable_in_incognito: typing.Optional[bool] = None ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: r''' Installs an unpacked extension from the filesystem similar to @@ -40,10 +103,13 @@ def load_unpacked( flag is set. :param path: Absolute file path. + :param enable_in_incognito: *(Optional)* Enable the extension in incognito :returns: Extension id. ''' params: T_JSON_DICT = dict() params['path'] = path + if enable_in_incognito is not None: + params['enableInIncognito'] = enable_in_incognito cmd_dict: T_JSON_DICT = { 'method': 'Extensions.loadUnpacked', 'params': params, @@ -52,6 +118,21 @@ def load_unpacked( return str(json['id']) +def get_extensions() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ExtensionInfo]]: + r''' + Gets a list of all unpacked extensions. + Available if the client is connected using the --remote-debugging-pipe flag + and the --enable-unsafe-extension-debugging flag is set. + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Extensions.getExtensions', + } + json = yield cmd_dict + return [ExtensionInfo.from_json(i) for i in json['extensions']] + + def uninstall( id_: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: diff --git a/cdp/network.py b/cdp/network.py index e2a7dbb..9a095b5 100644 --- a/cdp/network.py +++ b/cdp/network.py @@ -386,6 +386,24 @@ def from_json(cls, json: str) -> ResourcePriority: return cls(json) +class RenderBlockingBehavior(enum.Enum): + r''' + The render-blocking behavior of a resource request. + ''' + BLOCKING = "Blocking" + IN_BODY_PARSER_BLOCKING = "InBodyParserBlocking" + NON_BLOCKING = "NonBlocking" + NON_BLOCKING_DYNAMIC = "NonBlockingDynamic" + POTENTIALLY_BLOCKING = "PotentiallyBlocking" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> RenderBlockingBehavior: + return cls(json) + + @dataclass class PostDataEntry: r''' @@ -699,27 +717,6 @@ def from_json(cls, json: str) -> BlockedReason: return cls(json) -class IpProxyStatus(enum.Enum): - r''' - Sets Controls for IP Proxy of requests. - Page reload is required before the new behavior will be observed. - ''' - AVAILABLE = "Available" - FEATURE_NOT_ENABLED = "FeatureNotEnabled" - MASKED_DOMAIN_LIST_NOT_ENABLED = "MaskedDomainListNotEnabled" - MASKED_DOMAIN_LIST_NOT_POPULATED = "MaskedDomainListNotPopulated" - AUTH_TOKENS_UNAVAILABLE = "AuthTokensUnavailable" - UNAVAILABLE = "Unavailable" - BYPASSED_BY_DEV_TOOLS = "BypassedByDevTools" - - def to_json(self) -> str: - return self.value - - @classmethod - def from_json(cls, json: str) -> IpProxyStatus: - return cls(json) - - class CorsError(enum.Enum): r''' The reason why request was blocked. @@ -743,21 +740,14 @@ class CorsError(enum.Enum): PREFLIGHT_INVALID_ALLOW_CREDENTIALS = "PreflightInvalidAllowCredentials" PREFLIGHT_MISSING_ALLOW_EXTERNAL = "PreflightMissingAllowExternal" PREFLIGHT_INVALID_ALLOW_EXTERNAL = "PreflightInvalidAllowExternal" - PREFLIGHT_MISSING_ALLOW_PRIVATE_NETWORK = "PreflightMissingAllowPrivateNetwork" - PREFLIGHT_INVALID_ALLOW_PRIVATE_NETWORK = "PreflightInvalidAllowPrivateNetwork" INVALID_ALLOW_METHODS_PREFLIGHT_RESPONSE = "InvalidAllowMethodsPreflightResponse" INVALID_ALLOW_HEADERS_PREFLIGHT_RESPONSE = "InvalidAllowHeadersPreflightResponse" METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE = "MethodDisallowedByPreflightResponse" HEADER_DISALLOWED_BY_PREFLIGHT_RESPONSE = "HeaderDisallowedByPreflightResponse" REDIRECT_CONTAINS_CREDENTIALS = "RedirectContainsCredentials" - INSECURE_PRIVATE_NETWORK = "InsecurePrivateNetwork" - INVALID_PRIVATE_NETWORK_ACCESS = "InvalidPrivateNetworkAccess" - UNEXPECTED_PRIVATE_NETWORK_ACCESS = "UnexpectedPrivateNetworkAccess" + INSECURE_LOCAL_NETWORK = "InsecureLocalNetwork" + INVALID_LOCAL_NETWORK_ACCESS = "InvalidLocalNetworkAccess" NO_CORS_REDIRECT_MODE_NOT_FOLLOW = "NoCorsRedirectModeNotFollow" - PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID = "PreflightMissingPrivateNetworkAccessId" - PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME = "PreflightMissingPrivateNetworkAccessName" - PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE = "PrivateNetworkAccessPermissionUnavailable" - PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED = "PrivateNetworkAccessPermissionDenied" LOCAL_NETWORK_ACCESS_PERMISSION_DENIED = "LocalNetworkAccessPermissionDenied" def to_json(self) -> str: @@ -1012,10 +1002,6 @@ class Response: #: Security details for the request. security_details: typing.Optional[SecurityDetails] = None - #: Indicates whether the request was sent through IP Protection proxies. If - #: set to true, the request used the IP Protection privacy feature. - is_ip_protection_used: typing.Optional[bool] = None - def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() json['url'] = self.url @@ -1062,8 +1048,6 @@ def to_json(self) -> T_JSON_DICT: json['alternateProtocolUsage'] = self.alternate_protocol_usage.to_json() if self.security_details is not None: json['securityDetails'] = self.security_details.to_json() - if self.is_ip_protection_used is not None: - json['isIpProtectionUsed'] = self.is_ip_protection_used return json @classmethod @@ -1096,7 +1080,6 @@ def from_json(cls, json: T_JSON_DICT) -> Response: protocol=str(json['protocol']) if 'protocol' in json else None, alternate_protocol_usage=AlternateProtocolUsage.from_json(json['alternateProtocolUsage']) if 'alternateProtocolUsage' in json else None, security_details=SecurityDetails.from_json(json['securityDetails']) if 'securityDetails' in json else None, - is_ip_protection_used=bool(json['isIpProtectionUsed']) if 'isIpProtectionUsed' in json else None, ) @@ -1354,9 +1337,6 @@ class Cookie: #: Cookie Priority priority: CookiePriority - #: True if cookie is SameParty. - same_party: bool - #: Cookie source scheme type. source_scheme: CookieSourceScheme @@ -1386,7 +1366,6 @@ def to_json(self) -> T_JSON_DICT: json['secure'] = self.secure json['session'] = self.session json['priority'] = self.priority.to_json() - json['sameParty'] = self.same_party json['sourceScheme'] = self.source_scheme.to_json() json['sourcePort'] = self.source_port if self.same_site is not None: @@ -1410,7 +1389,6 @@ def from_json(cls, json: T_JSON_DICT) -> Cookie: secure=bool(json['secure']), session=bool(json['session']), priority=CookiePriority.from_json(json['priority']), - same_party=bool(json['sameParty']), source_scheme=CookieSourceScheme.from_json(json['sourceScheme']), source_port=int(json['sourcePort']), same_site=CookieSameSite.from_json(json['sameSite']) if 'sameSite' in json else None, @@ -1440,8 +1418,6 @@ class SetCookieBlockedReason(enum.Enum): SCHEMEFUL_SAME_SITE_STRICT = "SchemefulSameSiteStrict" SCHEMEFUL_SAME_SITE_LAX = "SchemefulSameSiteLax" SCHEMEFUL_SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = "SchemefulSameSiteUnspecifiedTreatedAsLax" - SAME_PARTY_FROM_CROSS_PARTY_CONTEXT = "SamePartyFromCrossPartyContext" - SAME_PARTY_CONFLICTS_WITH_OTHER_ATTRIBUTES = "SamePartyConflictsWithOtherAttributes" NAME_VALUE_PAIR_EXCEEDS_MAX_SIZE = "NameValuePairExceedsMaxSize" DISALLOWED_CHARACTER = "DisallowedCharacter" NO_COOKIE_CONTENT = "NoCookieContent" @@ -1472,7 +1448,6 @@ class CookieBlockedReason(enum.Enum): SCHEMEFUL_SAME_SITE_STRICT = "SchemefulSameSiteStrict" SCHEMEFUL_SAME_SITE_LAX = "SchemefulSameSiteLax" SCHEMEFUL_SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = "SchemefulSameSiteUnspecifiedTreatedAsLax" - SAME_PARTY_FROM_CROSS_PARTY_CONTEXT = "SamePartyFromCrossPartyContext" NAME_VALUE_PAIR_EXCEEDS_MAX_SIZE = "NameValuePairExceedsMaxSize" PORT_MISMATCH = "PortMismatch" SCHEME_MISMATCH = "SchemeMismatch" @@ -1644,9 +1619,6 @@ class CookieParam: #: Cookie Priority. priority: typing.Optional[CookiePriority] = None - #: True if cookie is SameParty. - same_party: typing.Optional[bool] = None - #: Cookie source scheme type. source_scheme: typing.Optional[CookieSourceScheme] = None @@ -1678,8 +1650,6 @@ def to_json(self) -> T_JSON_DICT: json['expires'] = self.expires.to_json() if self.priority is not None: json['priority'] = self.priority.to_json() - if self.same_party is not None: - json['sameParty'] = self.same_party if self.source_scheme is not None: json['sourceScheme'] = self.source_scheme.to_json() if self.source_port is not None: @@ -1701,7 +1671,6 @@ def from_json(cls, json: T_JSON_DICT) -> CookieParam: same_site=CookieSameSite.from_json(json['sameSite']) if 'sameSite' in json else None, expires=TimeSinceEpoch.from_json(json['expires']) if 'expires' in json else None, priority=CookiePriority.from_json(json['priority']) if 'priority' in json else None, - same_party=bool(json['sameParty']) if 'sameParty' in json else None, source_scheme=CookieSourceScheme.from_json(json['sourceScheme']) if 'sourceScheme' in json else None, source_port=int(json['sourcePort']) if 'sourcePort' in json else None, partition_key=CookiePartitionKey.from_json(json['partitionKey']) if 'partitionKey' in json else None, @@ -2201,6 +2170,13 @@ class DirectUDPSocketOptions: #: Expected to be unsigned integer. receive_buffer_size: typing.Optional[float] = None + multicast_loopback: typing.Optional[bool] = None + + #: Unsigned int 8. + multicast_time_to_live: typing.Optional[int] = None + + multicast_allow_address_sharing: typing.Optional[bool] = None + def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() if self.remote_addr is not None: @@ -2217,6 +2193,12 @@ def to_json(self) -> T_JSON_DICT: json['sendBufferSize'] = self.send_buffer_size if self.receive_buffer_size is not None: json['receiveBufferSize'] = self.receive_buffer_size + if self.multicast_loopback is not None: + json['multicastLoopback'] = self.multicast_loopback + if self.multicast_time_to_live is not None: + json['multicastTimeToLive'] = self.multicast_time_to_live + if self.multicast_allow_address_sharing is not None: + json['multicastAllowAddressSharing'] = self.multicast_allow_address_sharing return json @classmethod @@ -2229,6 +2211,9 @@ def from_json(cls, json: T_JSON_DICT) -> DirectUDPSocketOptions: dns_query_type=DirectSocketDnsQueryType.from_json(json['dnsQueryType']) if 'dnsQueryType' in json else None, send_buffer_size=float(json['sendBufferSize']) if 'sendBufferSize' in json else None, receive_buffer_size=float(json['receiveBufferSize']) if 'receiveBufferSize' in json else None, + multicast_loopback=bool(json['multicastLoopback']) if 'multicastLoopback' in json else None, + multicast_time_to_live=int(json['multicastTimeToLive']) if 'multicastTimeToLive' in json else None, + multicast_allow_address_sharing=bool(json['multicastAllowAddressSharing']) if 'multicastAllowAddressSharing' in json else None, ) @@ -2261,7 +2246,7 @@ def from_json(cls, json: T_JSON_DICT) -> DirectUDPMessage: ) -class PrivateNetworkRequestPolicy(enum.Enum): +class LocalNetworkAccessRequestPolicy(enum.Enum): ALLOW = "Allow" BLOCK_FROM_INSECURE_TO_MORE_PRIVATE = "BlockFromInsecureToMorePrivate" WARN_FROM_INSECURE_TO_MORE_PRIVATE = "WarnFromInsecureToMorePrivate" @@ -2272,7 +2257,7 @@ def to_json(self) -> str: return self.value @classmethod - def from_json(cls, json: str) -> PrivateNetworkRequestPolicy: + def from_json(cls, json: str) -> LocalNetworkAccessRequestPolicy: return cls(json) @@ -2315,13 +2300,13 @@ class ClientSecurityState: initiator_ip_address_space: IPAddressSpace - private_network_request_policy: PrivateNetworkRequestPolicy + local_network_access_request_policy: LocalNetworkAccessRequestPolicy def to_json(self) -> T_JSON_DICT: json: T_JSON_DICT = dict() json['initiatorIsSecureContext'] = self.initiator_is_secure_context json['initiatorIPAddressSpace'] = self.initiator_ip_address_space.to_json() - json['privateNetworkRequestPolicy'] = self.private_network_request_policy.to_json() + json['localNetworkAccessRequestPolicy'] = self.local_network_access_request_policy.to_json() return json @classmethod @@ -2329,7 +2314,71 @@ def from_json(cls, json: T_JSON_DICT) -> ClientSecurityState: return cls( initiator_is_secure_context=bool(json['initiatorIsSecureContext']), initiator_ip_address_space=IPAddressSpace.from_json(json['initiatorIPAddressSpace']), - private_network_request_policy=PrivateNetworkRequestPolicy.from_json(json['privateNetworkRequestPolicy']), + local_network_access_request_policy=LocalNetworkAccessRequestPolicy.from_json(json['localNetworkAccessRequestPolicy']), + ) + + +@dataclass +class AdScriptIdentifier: + r''' + Identifies the script on the stack that caused a resource or element to be + labeled as an ad. For resources, this indicates the context that triggered + the fetch. For elements, this indicates the context that caused the element + to be appended to the DOM. + ''' + #: The script's V8 identifier. + script_id: runtime.ScriptId + + #: V8's debugging ID for the v8::Context. + debugger_id: runtime.UniqueDebuggerId + + #: The script's url (or generated name based on id if inline script). + name: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['scriptId'] = self.script_id.to_json() + json['debuggerId'] = self.debugger_id.to_json() + json['name'] = self.name + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AdScriptIdentifier: + return cls( + script_id=runtime.ScriptId.from_json(json['scriptId']), + debugger_id=runtime.UniqueDebuggerId.from_json(json['debuggerId']), + name=str(json['name']), + ) + + +@dataclass +class AdAncestry: + r''' + Encapsulates the script ancestry and the root script filter list rule that + caused the resource or element to be labeled as an ad. + ''' + #: A chain of ``AdScriptIdentifier``'s representing the ancestry of an ad + #: script that led to the creation of a resource or element. The chain is + #: ordered from the script itself (lowest level) up to its root ancestor + #: that was flagged by a filter list. + ancestry_chain: typing.List[AdScriptIdentifier] + + #: The filter list rule that caused the root (last) script in + #: ``ancestryChain`` to be tagged as an ad. + root_script_filterlist_rule: typing.Optional[str] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['ancestryChain'] = [i.to_json() for i in self.ancestry_chain] + if self.root_script_filterlist_rule is not None: + json['rootScriptFilterlistRule'] = self.root_script_filterlist_rule + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AdAncestry: + return cls( + ancestry_chain=[AdScriptIdentifier.from_json(i) for i in json['ancestryChain']], + root_script_filterlist_rule=str(json['rootScriptFilterlistRule']) if 'rootScriptFilterlistRule' in json else None, ) @@ -2594,6 +2643,475 @@ def from_json(cls, json: T_JSON_DICT) -> ReportingApiEndpoint: ) +@dataclass +class DeviceBoundSessionKey: + r''' + Unique identifier for a device bound session. + ''' + #: The site the session is set up for. + site: str + + #: The id of the session. + id_: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['site'] = self.site + json['id'] = self.id_ + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionKey: + return cls( + site=str(json['site']), + id_=str(json['id']), + ) + + +@dataclass +class DeviceBoundSessionWithUsage: + r''' + How a device bound session was used during a request. + ''' + #: The key for the session. + session_key: DeviceBoundSessionKey + + #: How the session was used (or not used). + usage: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['sessionKey'] = self.session_key.to_json() + json['usage'] = self.usage + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionWithUsage: + return cls( + session_key=DeviceBoundSessionKey.from_json(json['sessionKey']), + usage=str(json['usage']), + ) + + +@dataclass +class DeviceBoundSessionCookieCraving: + r''' + A device bound session's cookie craving. + ''' + #: The name of the craving. + name: str + + #: The domain of the craving. + domain: str + + #: The path of the craving. + path: str + + #: The ``Secure`` attribute of the craving attributes. + secure: bool + + #: The ``HttpOnly`` attribute of the craving attributes. + http_only: bool + + #: The ``SameSite`` attribute of the craving attributes. + same_site: typing.Optional[CookieSameSite] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['name'] = self.name + json['domain'] = self.domain + json['path'] = self.path + json['secure'] = self.secure + json['httpOnly'] = self.http_only + if self.same_site is not None: + json['sameSite'] = self.same_site.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionCookieCraving: + return cls( + name=str(json['name']), + domain=str(json['domain']), + path=str(json['path']), + secure=bool(json['secure']), + http_only=bool(json['httpOnly']), + same_site=CookieSameSite.from_json(json['sameSite']) if 'sameSite' in json else None, + ) + + +@dataclass +class DeviceBoundSessionUrlRule: + r''' + A device bound session's inclusion URL rule. + ''' + #: See comments on ``net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type``. + rule_type: str + + #: See comments on ``net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern``. + host_pattern: str + + #: See comments on ``net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix``. + path_prefix: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['ruleType'] = self.rule_type + json['hostPattern'] = self.host_pattern + json['pathPrefix'] = self.path_prefix + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionUrlRule: + return cls( + rule_type=str(json['ruleType']), + host_pattern=str(json['hostPattern']), + path_prefix=str(json['pathPrefix']), + ) + + +@dataclass +class DeviceBoundSessionInclusionRules: + r''' + A device bound session's inclusion rules. + ''' + #: See comments on ``net::device_bound_sessions::SessionInclusionRules::origin_``. + origin: str + + #: Whether the whole site is included. See comments on + #: ``net::device_bound_sessions::SessionInclusionRules::include_site_`` for more + #: details; this boolean is true if that value is populated. + include_site: bool + + #: See comments on ``net::device_bound_sessions::SessionInclusionRules::url_rules_``. + url_rules: typing.List[DeviceBoundSessionUrlRule] + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['origin'] = self.origin + json['includeSite'] = self.include_site + json['urlRules'] = [i.to_json() for i in self.url_rules] + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionInclusionRules: + return cls( + origin=str(json['origin']), + include_site=bool(json['includeSite']), + url_rules=[DeviceBoundSessionUrlRule.from_json(i) for i in json['urlRules']], + ) + + +@dataclass +class DeviceBoundSession: + r''' + A device bound session. + ''' + #: The site and session ID of the session. + key: DeviceBoundSessionKey + + #: See comments on ``net::device_bound_sessions::Session::refresh_url_``. + refresh_url: str + + #: See comments on ``net::device_bound_sessions::Session::inclusion_rules_``. + inclusion_rules: DeviceBoundSessionInclusionRules + + #: See comments on ``net::device_bound_sessions::Session::cookie_cravings_``. + cookie_cravings: typing.List[DeviceBoundSessionCookieCraving] + + #: See comments on ``net::device_bound_sessions::Session::expiry_date_``. + expiry_date: TimeSinceEpoch + + #: See comments on ``net::device_bound_sessions::Session::allowed_refresh_initiators_``. + allowed_refresh_initiators: typing.List[str] + + #: See comments on ``net::device_bound_sessions::Session::cached_challenge__``. + cached_challenge: typing.Optional[str] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['key'] = self.key.to_json() + json['refreshUrl'] = self.refresh_url + json['inclusionRules'] = self.inclusion_rules.to_json() + json['cookieCravings'] = [i.to_json() for i in self.cookie_cravings] + json['expiryDate'] = self.expiry_date.to_json() + json['allowedRefreshInitiators'] = [i for i in self.allowed_refresh_initiators] + if self.cached_challenge is not None: + json['cachedChallenge'] = self.cached_challenge + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSession: + return cls( + key=DeviceBoundSessionKey.from_json(json['key']), + refresh_url=str(json['refreshUrl']), + inclusion_rules=DeviceBoundSessionInclusionRules.from_json(json['inclusionRules']), + cookie_cravings=[DeviceBoundSessionCookieCraving.from_json(i) for i in json['cookieCravings']], + expiry_date=TimeSinceEpoch.from_json(json['expiryDate']), + allowed_refresh_initiators=[str(i) for i in json['allowedRefreshInitiators']], + cached_challenge=str(json['cachedChallenge']) if 'cachedChallenge' in json else None, + ) + + +class DeviceBoundSessionEventId(str): + r''' + A unique identifier for a device bound session event. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> DeviceBoundSessionEventId: + return cls(json) + + def __repr__(self): + return 'DeviceBoundSessionEventId({})'.format(super().__repr__()) + + +class DeviceBoundSessionFetchResult(enum.Enum): + r''' + A fetch result for a device bound session creation or refresh. + ''' + SUCCESS = "Success" + KEY_ERROR = "KeyError" + SIGNING_ERROR = "SigningError" + SERVER_REQUESTED_TERMINATION = "ServerRequestedTermination" + INVALID_SESSION_ID = "InvalidSessionId" + INVALID_CHALLENGE = "InvalidChallenge" + TOO_MANY_CHALLENGES = "TooManyChallenges" + INVALID_FETCHER_URL = "InvalidFetcherUrl" + INVALID_REFRESH_URL = "InvalidRefreshUrl" + TRANSIENT_HTTP_ERROR = "TransientHttpError" + SCOPE_ORIGIN_SAME_SITE_MISMATCH = "ScopeOriginSameSiteMismatch" + REFRESH_URL_SAME_SITE_MISMATCH = "RefreshUrlSameSiteMismatch" + MISMATCHED_SESSION_ID = "MismatchedSessionId" + MISSING_SCOPE = "MissingScope" + NO_CREDENTIALS = "NoCredentials" + SUBDOMAIN_REGISTRATION_WELL_KNOWN_UNAVAILABLE = "SubdomainRegistrationWellKnownUnavailable" + SUBDOMAIN_REGISTRATION_UNAUTHORIZED = "SubdomainRegistrationUnauthorized" + SUBDOMAIN_REGISTRATION_WELL_KNOWN_MALFORMED = "SubdomainRegistrationWellKnownMalformed" + SESSION_PROVIDER_WELL_KNOWN_UNAVAILABLE = "SessionProviderWellKnownUnavailable" + RELYING_PARTY_WELL_KNOWN_UNAVAILABLE = "RelyingPartyWellKnownUnavailable" + FEDERATED_KEY_THUMBPRINT_MISMATCH = "FederatedKeyThumbprintMismatch" + INVALID_FEDERATED_SESSION_URL = "InvalidFederatedSessionUrl" + INVALID_FEDERATED_KEY = "InvalidFederatedKey" + TOO_MANY_RELYING_ORIGIN_LABELS = "TooManyRelyingOriginLabels" + BOUND_COOKIE_SET_FORBIDDEN = "BoundCookieSetForbidden" + NET_ERROR = "NetError" + PROXY_ERROR = "ProxyError" + EMPTY_SESSION_CONFIG = "EmptySessionConfig" + INVALID_CREDENTIALS_CONFIG = "InvalidCredentialsConfig" + INVALID_CREDENTIALS_TYPE = "InvalidCredentialsType" + INVALID_CREDENTIALS_EMPTY_NAME = "InvalidCredentialsEmptyName" + INVALID_CREDENTIALS_COOKIE = "InvalidCredentialsCookie" + PERSISTENT_HTTP_ERROR = "PersistentHttpError" + REGISTRATION_ATTEMPTED_CHALLENGE = "RegistrationAttemptedChallenge" + INVALID_SCOPE_ORIGIN = "InvalidScopeOrigin" + SCOPE_ORIGIN_CONTAINS_PATH = "ScopeOriginContainsPath" + REFRESH_INITIATOR_NOT_STRING = "RefreshInitiatorNotString" + REFRESH_INITIATOR_INVALID_HOST_PATTERN = "RefreshInitiatorInvalidHostPattern" + INVALID_SCOPE_SPECIFICATION = "InvalidScopeSpecification" + MISSING_SCOPE_SPECIFICATION_TYPE = "MissingScopeSpecificationType" + EMPTY_SCOPE_SPECIFICATION_DOMAIN = "EmptyScopeSpecificationDomain" + EMPTY_SCOPE_SPECIFICATION_PATH = "EmptyScopeSpecificationPath" + INVALID_SCOPE_SPECIFICATION_TYPE = "InvalidScopeSpecificationType" + INVALID_SCOPE_INCLUDE_SITE = "InvalidScopeIncludeSite" + MISSING_SCOPE_INCLUDE_SITE = "MissingScopeIncludeSite" + FEDERATED_NOT_AUTHORIZED_BY_PROVIDER = "FederatedNotAuthorizedByProvider" + FEDERATED_NOT_AUTHORIZED_BY_RELYING_PARTY = "FederatedNotAuthorizedByRelyingParty" + SESSION_PROVIDER_WELL_KNOWN_MALFORMED = "SessionProviderWellKnownMalformed" + SESSION_PROVIDER_WELL_KNOWN_HAS_PROVIDER_ORIGIN = "SessionProviderWellKnownHasProviderOrigin" + RELYING_PARTY_WELL_KNOWN_MALFORMED = "RelyingPartyWellKnownMalformed" + RELYING_PARTY_WELL_KNOWN_HAS_RELYING_ORIGINS = "RelyingPartyWellKnownHasRelyingOrigins" + INVALID_FEDERATED_SESSION_PROVIDER_SESSION_MISSING = "InvalidFederatedSessionProviderSessionMissing" + INVALID_FEDERATED_SESSION_WRONG_PROVIDER_ORIGIN = "InvalidFederatedSessionWrongProviderOrigin" + INVALID_CREDENTIALS_COOKIE_CREATION_TIME = "InvalidCredentialsCookieCreationTime" + INVALID_CREDENTIALS_COOKIE_NAME = "InvalidCredentialsCookieName" + INVALID_CREDENTIALS_COOKIE_PARSING = "InvalidCredentialsCookieParsing" + INVALID_CREDENTIALS_COOKIE_UNPERMITTED_ATTRIBUTE = "InvalidCredentialsCookieUnpermittedAttribute" + INVALID_CREDENTIALS_COOKIE_INVALID_DOMAIN = "InvalidCredentialsCookieInvalidDomain" + INVALID_CREDENTIALS_COOKIE_PREFIX = "InvalidCredentialsCookiePrefix" + INVALID_SCOPE_RULE_PATH = "InvalidScopeRulePath" + INVALID_SCOPE_RULE_HOST_PATTERN = "InvalidScopeRuleHostPattern" + SCOPE_RULE_ORIGIN_SCOPED_HOST_PATTERN_MISMATCH = "ScopeRuleOriginScopedHostPatternMismatch" + SCOPE_RULE_SITE_SCOPED_HOST_PATTERN_MISMATCH = "ScopeRuleSiteScopedHostPatternMismatch" + SIGNING_QUOTA_EXCEEDED = "SigningQuotaExceeded" + INVALID_CONFIG_JSON = "InvalidConfigJson" + INVALID_FEDERATED_SESSION_PROVIDER_FAILED_TO_RESTORE_KEY = "InvalidFederatedSessionProviderFailedToRestoreKey" + FAILED_TO_UNWRAP_KEY = "FailedToUnwrapKey" + SESSION_DELETED_DURING_REFRESH = "SessionDeletedDuringRefresh" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> DeviceBoundSessionFetchResult: + return cls(json) + + +@dataclass +class DeviceBoundSessionFailedRequest: + r''' + Details about a failed device bound session network request. + ''' + #: The failed request URL. + request_url: str + + #: The net error of the response if it was not OK. + net_error: typing.Optional[str] = None + + #: The response code if the net error was OK and the response code was not + #: 200. + response_error: typing.Optional[int] = None + + #: The body of the response if the net error was OK, the response code was + #: not 200, and the response body was not empty. + response_error_body: typing.Optional[str] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['requestUrl'] = self.request_url + if self.net_error is not None: + json['netError'] = self.net_error + if self.response_error is not None: + json['responseError'] = self.response_error + if self.response_error_body is not None: + json['responseErrorBody'] = self.response_error_body + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionFailedRequest: + return cls( + request_url=str(json['requestUrl']), + net_error=str(json['netError']) if 'netError' in json else None, + response_error=int(json['responseError']) if 'responseError' in json else None, + response_error_body=str(json['responseErrorBody']) if 'responseErrorBody' in json else None, + ) + + +@dataclass +class CreationEventDetails: + r''' + Session event details specific to creation. + ''' + #: The result of the fetch attempt. + fetch_result: DeviceBoundSessionFetchResult + + #: The session if there was a newly created session. This is populated for + #: all successful creation events. + new_session: typing.Optional[DeviceBoundSession] = None + + #: Details about a failed device bound session network request if there was + #: one. + failed_request: typing.Optional[DeviceBoundSessionFailedRequest] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['fetchResult'] = self.fetch_result.to_json() + if self.new_session is not None: + json['newSession'] = self.new_session.to_json() + if self.failed_request is not None: + json['failedRequest'] = self.failed_request.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CreationEventDetails: + return cls( + fetch_result=DeviceBoundSessionFetchResult.from_json(json['fetchResult']), + new_session=DeviceBoundSession.from_json(json['newSession']) if 'newSession' in json else None, + failed_request=DeviceBoundSessionFailedRequest.from_json(json['failedRequest']) if 'failedRequest' in json else None, + ) + + +@dataclass +class RefreshEventDetails: + r''' + Session event details specific to refresh. + ''' + #: The result of a refresh. + refresh_result: str + + #: See comments on ``net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh``. + was_fully_proactive_refresh: bool + + #: If there was a fetch attempt, the result of that. + fetch_result: typing.Optional[DeviceBoundSessionFetchResult] = None + + #: The session display if there was a newly created session. This is populated + #: for any refresh event that modifies the session config. + new_session: typing.Optional[DeviceBoundSession] = None + + #: Details about a failed device bound session network request if there was + #: one. + failed_request: typing.Optional[DeviceBoundSessionFailedRequest] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['refreshResult'] = self.refresh_result + json['wasFullyProactiveRefresh'] = self.was_fully_proactive_refresh + if self.fetch_result is not None: + json['fetchResult'] = self.fetch_result.to_json() + if self.new_session is not None: + json['newSession'] = self.new_session.to_json() + if self.failed_request is not None: + json['failedRequest'] = self.failed_request.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RefreshEventDetails: + return cls( + refresh_result=str(json['refreshResult']), + was_fully_proactive_refresh=bool(json['wasFullyProactiveRefresh']), + fetch_result=DeviceBoundSessionFetchResult.from_json(json['fetchResult']) if 'fetchResult' in json else None, + new_session=DeviceBoundSession.from_json(json['newSession']) if 'newSession' in json else None, + failed_request=DeviceBoundSessionFailedRequest.from_json(json['failedRequest']) if 'failedRequest' in json else None, + ) + + +@dataclass +class TerminationEventDetails: + r''' + Session event details specific to termination. + ''' + #: The reason for a session being deleted. + deletion_reason: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['deletionReason'] = self.deletion_reason + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TerminationEventDetails: + return cls( + deletion_reason=str(json['deletionReason']), + ) + + +@dataclass +class ChallengeEventDetails: + r''' + Session event details specific to challenges. + ''' + #: The result of a challenge. + challenge_result: str + + #: The challenge set. + challenge: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['challengeResult'] = self.challenge_result + json['challenge'] = self.challenge + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ChallengeEventDetails: + return cls( + challenge_result=str(json['challengeResult']), + challenge=str(json['challenge']), + ) + + @dataclass class LoadNetworkResourcePageResult: r''' @@ -2665,41 +3183,6 @@ def from_json(cls, json: T_JSON_DICT) -> LoadNetworkResourceOptions: ) -def get_ip_protection_proxy_status() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,IpProxyStatus]: - r''' - Returns enum representing if IP Proxy of requests is available - or reason it is not active. - - **EXPERIMENTAL** - - :returns: Whether IP proxy is available - ''' - cmd_dict: T_JSON_DICT = { - 'method': 'Network.getIPProtectionProxyStatus', - } - json = yield cmd_dict - return IpProxyStatus.from_json(json['status']) - - -def set_ip_protection_proxy_bypass_enabled( - enabled: bool - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: - r''' - Sets bypass IP Protection Proxy boolean. - - **EXPERIMENTAL** - - :param enabled: Whether IP Proxy is being bypassed by devtools; false by default. - ''' - params: T_JSON_DICT = dict() - params['enabled'] = enabled - cmd_dict: T_JSON_DICT = { - 'method': 'Network.setIPProtectionProxyBypassEnabled', - 'params': params, - } - json = yield cmd_dict - - def set_accepted_encodings( encodings: typing.List[ContentEncoding] ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: @@ -3010,11 +3493,11 @@ def enable( r''' Enables network tracking, network events will now be delivered to the client. - :param max_total_buffer_size: **(EXPERIMENTAL)** *(Optional)* Buffer size in bytes to use when preserving network payloads (XHRs, etc). + :param max_total_buffer_size: **(EXPERIMENTAL)** *(Optional)* Buffer size in bytes to use when preserving network payloads (XHRs, etc). This is the maximum number of bytes that will be collected by this DevTools session. :param max_resource_buffer_size: **(EXPERIMENTAL)** *(Optional)* Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). :param max_post_data_size: *(Optional)* Longest post body size (in bytes) that would be included in requestWillBeSent notification :param report_direct_socket_traffic: **(EXPERIMENTAL)** *(Optional)* Whether DirectSocket chunk send/receive events should be reported. - :param enable_durable_messages: **(EXPERIMENTAL)** *(Optional)* Enable storing response bodies outside of renderer, so that these survive a cross-process navigation. Requires maxTotalBufferSize to be set. Currently defaults to false. + :param enable_durable_messages: **(EXPERIMENTAL)** *(Optional)* Enable storing response bodies outside of renderer, so that these survive a cross-process navigation. Requires maxTotalBufferSize to be set. Currently defaults to false. This field is being deprecated in favor of the dedicated configureDurableMessages command, due to the possibility of deadlocks when awaiting Network.enable before issuing Runtime.runIfWaitingForDebugger. ''' params: T_JSON_DICT = dict() if max_total_buffer_size is not None: @@ -3034,6 +3517,32 @@ def enable( json = yield cmd_dict +def configure_durable_messages( + max_total_buffer_size: typing.Optional[int] = None, + max_resource_buffer_size: typing.Optional[int] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Configures storing response bodies outside of renderer, so that these survive + a cross-process navigation. + If maxTotalBufferSize is not set, durable messages are disabled. + + **EXPERIMENTAL** + + :param max_total_buffer_size: *(Optional)* Buffer size in bytes to use when preserving network payloads (XHRs, etc). + :param max_resource_buffer_size: *(Optional)* Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + ''' + params: T_JSON_DICT = dict() + if max_total_buffer_size is not None: + params['maxTotalBufferSize'] = max_total_buffer_size + if max_resource_buffer_size is not None: + params['maxResourceBufferSize'] = max_resource_buffer_size + cmd_dict: T_JSON_DICT = { + 'method': 'Network.configureDurableMessages', + 'params': params, + } + json = yield cmd_dict + + @deprecated(version="1.3") def get_all_cookies() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Cookie]]: r''' @@ -3121,12 +3630,15 @@ def get_response_body( def get_request_post_data( request_id: RequestId - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str, bool]]: r''' Returns post data sent with the request. Returns an error when no data was sent with the request. :param request_id: Identifier of the network request to get content for. - :returns: Request body string, omitting files from multipart requests + :returns: A tuple with the following items: + + 0. **postData** - Request body string, omitting files from multipart requests + 1. **base64Encoded** - True, if content was sent as base64. ''' params: T_JSON_DICT = dict() params['requestId'] = request_id.to_json() @@ -3135,7 +3647,10 @@ def get_request_post_data( 'params': params, } json = yield cmd_dict - return str(json['postData']) + return ( + str(json['postData']), + bool(json['base64Encoded']) + ) def get_response_body_for_interception( @@ -3311,7 +3826,6 @@ def set_cookie( same_site: typing.Optional[CookieSameSite] = None, expires: typing.Optional[TimeSinceEpoch] = None, priority: typing.Optional[CookiePriority] = None, - same_party: typing.Optional[bool] = None, source_scheme: typing.Optional[CookieSourceScheme] = None, source_port: typing.Optional[int] = None, partition_key: typing.Optional[CookiePartitionKey] = None @@ -3329,7 +3843,6 @@ def set_cookie( :param same_site: *(Optional)* Cookie SameSite type. :param expires: *(Optional)* Cookie expiration date, session cookie if not set :param priority: **(EXPERIMENTAL)** *(Optional)* Cookie Priority type. - :param same_party: **(EXPERIMENTAL)** *(Optional)* True if cookie is SameParty. :param source_scheme: **(EXPERIMENTAL)** *(Optional)* Cookie source scheme type. :param source_port: **(EXPERIMENTAL)** *(Optional)* Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future. :param partition_key: **(EXPERIMENTAL)** *(Optional)* Cookie partition key. If not set, the cookie will be set as not partitioned. @@ -3354,8 +3867,6 @@ def set_cookie( params['expires'] = expires.to_json() if priority is not None: params['priority'] = priority.to_json() - if same_party is not None: - params['sameParty'] = same_party if source_scheme is not None: params['sourceScheme'] = source_scheme.to_json() if source_port is not None: @@ -3539,6 +4050,46 @@ def enable_reporting_api( json = yield cmd_dict +def enable_device_bound_sessions( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Sets up tracking device bound sessions and fetching of initial set of sessions. + + **EXPERIMENTAL** + + :param enable: Whether to enable or disable events. + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Network.enableDeviceBoundSessions', + 'params': params, + } + json = yield cmd_dict + + +def fetch_schemeful_site( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + r''' + Fetches the schemeful site for a specific origin. + + **EXPERIMENTAL** + + :param origin: The URL origin. + :returns: The corresponding schemeful site. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Network.fetchSchemefulSite', + 'params': params, + } + json = yield cmd_dict + return str(json['schemefulSite']) + + def load_network_resource( url: str, options: LoadNetworkResourceOptions, @@ -3814,6 +4365,8 @@ class RequestWillBeSent: frame_id: typing.Optional[page.FrameId] #: Whether the request is initiated by a user gesture. Defaults to false. has_user_gesture: typing.Optional[bool] + #: The render-blocking behavior of the request. + render_blocking_behavior: typing.Optional[RenderBlockingBehavior] @classmethod def from_json(cls, json: T_JSON_DICT) -> RequestWillBeSent: @@ -3829,7 +4382,8 @@ def from_json(cls, json: T_JSON_DICT) -> RequestWillBeSent: redirect_response=Response.from_json(json['redirectResponse']) if 'redirectResponse' in json else None, type_=ResourceType.from_json(json['type']) if 'type' in json else None, frame_id=page.FrameId.from_json(json['frameId']) if 'frameId' in json else None, - has_user_gesture=bool(json['hasUserGesture']) if 'hasUserGesture' in json else None + has_user_gesture=bool(json['hasUserGesture']) if 'hasUserGesture' in json else None, + render_blocking_behavior=RenderBlockingBehavior.from_json(json['renderBlockingBehavior']) if 'renderBlockingBehavior' in json else None ) @@ -4269,6 +4823,44 @@ def from_json(cls, json: T_JSON_DICT) -> DirectTCPSocketChunkReceived: ) +@event_class('Network.directUDPSocketJoinedMulticastGroup') +@dataclass +class DirectUDPSocketJoinedMulticastGroup: + r''' + **EXPERIMENTAL** + + + ''' + identifier: RequestId + ip_address: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DirectUDPSocketJoinedMulticastGroup: + return cls( + identifier=RequestId.from_json(json['identifier']), + ip_address=str(json['IPAddress']) + ) + + +@event_class('Network.directUDPSocketLeftMulticastGroup') +@dataclass +class DirectUDPSocketLeftMulticastGroup: + r''' + **EXPERIMENTAL** + + + ''' + identifier: RequestId + ip_address: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DirectUDPSocketLeftMulticastGroup: + return cls( + identifier=RequestId.from_json(json['identifier']), + ip_address=str(json['IPAddress']) + ) + + @event_class('Network.directUDPSocketCreated') @dataclass class DirectUDPSocketCreated: @@ -4423,6 +5015,8 @@ class RequestWillBeSentExtraInfo: headers: Headers #: Connection timing information for the request. connect_timing: ConnectTiming + #: How the request site's device bound sessions were used during this request. + device_bound_session_usages: typing.Optional[typing.List[DeviceBoundSessionWithUsage]] #: The client security state set for the request. client_security_state: typing.Optional[ClientSecurityState] #: Whether the site has partitioned cookies stored in a partition different than the current one. @@ -4438,6 +5032,7 @@ def from_json(cls, json: T_JSON_DICT) -> RequestWillBeSentExtraInfo: associated_cookies=[AssociatedCookie.from_json(i) for i in json['associatedCookies']], headers=Headers.from_json(json['headers']), connect_timing=ConnectTiming.from_json(json['connectTiming']), + device_bound_session_usages=[DeviceBoundSessionWithUsage.from_json(i) for i in json['deviceBoundSessionUsages']] if 'deviceBoundSessionUsages' in json else None, client_security_state=ClientSecurityState.from_json(json['clientSecurityState']) if 'clientSecurityState' in json else None, site_has_cookie_in_other_partition=bool(json['siteHasCookieInOtherPartition']) if 'siteHasCookieInOtherPartition' in json else None, applied_network_conditions_id=str(json['appliedNetworkConditionsId']) if 'appliedNetworkConditionsId' in json else None @@ -4632,3 +5227,58 @@ def from_json(cls, json: T_JSON_DICT) -> ReportingApiEndpointsChangedForOrigin: origin=str(json['origin']), endpoints=[ReportingApiEndpoint.from_json(i) for i in json['endpoints']] ) + + +@event_class('Network.deviceBoundSessionsAdded') +@dataclass +class DeviceBoundSessionsAdded: + r''' + **EXPERIMENTAL** + + Triggered when the initial set of device bound sessions is added. + ''' + #: The device bound sessions. + sessions: typing.List[DeviceBoundSession] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionsAdded: + return cls( + sessions=[DeviceBoundSession.from_json(i) for i in json['sessions']] + ) + + +@event_class('Network.deviceBoundSessionEventOccurred') +@dataclass +class DeviceBoundSessionEventOccurred: + r''' + **EXPERIMENTAL** + + Triggered when a device bound session event occurs. + ''' + #: A unique identifier for this session event. + event_id: DeviceBoundSessionEventId + #: The site this session event is associated with. + site: str + #: Whether this event was considered successful. + succeeded: bool + #: The session ID this event is associated with. May not be populated for + #: failed events. + session_id: typing.Optional[str] + #: The below are the different session event type details. Exactly one is populated. + creation_event_details: typing.Optional[CreationEventDetails] + refresh_event_details: typing.Optional[RefreshEventDetails] + termination_event_details: typing.Optional[TerminationEventDetails] + challenge_event_details: typing.Optional[ChallengeEventDetails] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DeviceBoundSessionEventOccurred: + return cls( + event_id=DeviceBoundSessionEventId.from_json(json['eventId']), + site=str(json['site']), + succeeded=bool(json['succeeded']), + session_id=str(json['sessionId']) if 'sessionId' in json else None, + creation_event_details=CreationEventDetails.from_json(json['creationEventDetails']) if 'creationEventDetails' in json else None, + refresh_event_details=RefreshEventDetails.from_json(json['refreshEventDetails']) if 'refreshEventDetails' in json else None, + termination_event_details=TerminationEventDetails.from_json(json['terminationEventDetails']) if 'terminationEventDetails' in json else None, + challenge_event_details=ChallengeEventDetails.from_json(json['challengeEventDetails']) if 'challengeEventDetails' in json else None + ) diff --git a/cdp/overlay.py b/cdp/overlay.py index be71e74..c1da95a 100644 --- a/cdp/overlay.py +++ b/cdp/overlay.py @@ -762,6 +762,30 @@ def from_json(cls, json: str) -> InspectMode: return cls(json) +@dataclass +class InspectedElementAnchorConfig: + #: Identifier of the node to highlight. + node_id: typing.Optional[dom.NodeId] = None + + #: Identifier of the backend node to highlight. + backend_node_id: typing.Optional[dom.BackendNodeId] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + if self.node_id is not None: + json['nodeId'] = self.node_id.to_json() + if self.backend_node_id is not None: + json['backendNodeId'] = self.backend_node_id.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectedElementAnchorConfig: + return cls( + node_id=dom.NodeId.from_json(json['nodeId']) if 'nodeId' in json else None, + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) if 'backendNodeId' in json else None, + ) + + def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: r''' Disables domain notifications. @@ -1173,6 +1197,21 @@ def set_show_container_query_overlays( json = yield cmd_dict +def set_show_inspected_element_anchor( + inspected_element_anchor_config: InspectedElementAnchorConfig + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + :param inspected_element_anchor_config: Node identifier for which to show an anchor for. + ''' + params: T_JSON_DICT = dict() + params['inspectedElementAnchorConfig'] = inspected_element_anchor_config.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Overlay.setShowInspectedElementAnchor', + 'params': params, + } + json = yield cmd_dict + + def set_show_paint_rects( result: bool ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: @@ -1382,6 +1421,38 @@ def from_json(cls, json: T_JSON_DICT) -> ScreenshotRequested: ) +@event_class('Overlay.inspectPanelShowRequested') +@dataclass +class InspectPanelShowRequested: + r''' + Fired when user asks to show the Inspect panel. + ''' + #: Id of the node to show in the panel. + backend_node_id: dom.BackendNodeId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectPanelShowRequested: + return cls( + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) + ) + + +@event_class('Overlay.inspectedElementWindowRestored') +@dataclass +class InspectedElementWindowRestored: + r''' + Fired when user asks to restore the Inspected Element floating window. + ''' + #: Id of the node to restore the floating window for. + backend_node_id: dom.BackendNodeId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectedElementWindowRestored: + return cls( + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) + ) + + @event_class('Overlay.inspectModeCanceled') @dataclass class InspectModeCanceled: diff --git a/cdp/page.py b/cdp/page.py index 5ec40e7..21c5fb5 100644 --- a/cdp/page.py +++ b/cdp/page.py @@ -88,66 +88,6 @@ def from_json(cls, json: T_JSON_DICT) -> AdFrameStatus: ) -@dataclass -class AdScriptId: - r''' - Identifies the script which caused a script or frame to be labelled as an - ad. - ''' - #: Script Id of the script which caused a script or frame to be labelled as - #: an ad. - script_id: runtime.ScriptId - - #: Id of scriptId's debugger. - debugger_id: runtime.UniqueDebuggerId - - def to_json(self) -> T_JSON_DICT: - json: T_JSON_DICT = dict() - json['scriptId'] = self.script_id.to_json() - json['debuggerId'] = self.debugger_id.to_json() - return json - - @classmethod - def from_json(cls, json: T_JSON_DICT) -> AdScriptId: - return cls( - script_id=runtime.ScriptId.from_json(json['scriptId']), - debugger_id=runtime.UniqueDebuggerId.from_json(json['debuggerId']), - ) - - -@dataclass -class AdScriptAncestry: - r''' - Encapsulates the script ancestry and the root script filterlist rule that - caused the frame to be labelled as an ad. Only created when ``ancestryChain`` - is not empty. - ''' - #: A chain of ``AdScriptId``'s representing the ancestry of an ad script that - #: led to the creation of a frame. The chain is ordered from the script - #: itself (lower level) up to its root ancestor that was flagged by - #: filterlist. - ancestry_chain: typing.List[AdScriptId] - - #: The filterlist rule that caused the root (last) script in - #: ``ancestryChain`` to be ad-tagged. Only populated if the rule is - #: available. - root_script_filterlist_rule: typing.Optional[str] = None - - def to_json(self) -> T_JSON_DICT: - json: T_JSON_DICT = dict() - json['ancestryChain'] = [i.to_json() for i in self.ancestry_chain] - if self.root_script_filterlist_rule is not None: - json['rootScriptFilterlistRule'] = self.root_script_filterlist_rule - return json - - @classmethod - def from_json(cls, json: T_JSON_DICT) -> AdScriptAncestry: - return cls( - ancestry_chain=[AdScriptId.from_json(i) for i in json['ancestryChain']], - root_script_filterlist_rule=str(json['rootScriptFilterlistRule']) if 'rootScriptFilterlistRule' in json else None, - ) - - class SecureContextType(enum.Enum): r''' Indicates whether the frame is a secure context and why it is the case. @@ -206,6 +146,7 @@ class PermissionsPolicyFeature(enum.Enum): AMBIENT_LIGHT_SENSOR = "ambient-light-sensor" ARIA_NOTIFY = "aria-notify" ATTRIBUTION_REPORTING = "attribution-reporting" + AUTOFILL = "autofill" AUTOPLAY = "autoplay" BLUETOOTH = "bluetooth" BROWSING_TOPICS = "browsing-topics" @@ -269,8 +210,11 @@ class PermissionsPolicyFeature(enum.Enum): LANGUAGE_DETECTOR = "language-detector" LANGUAGE_MODEL = "language-model" LOCAL_FONTS = "local-fonts" + LOCAL_NETWORK = "local-network" LOCAL_NETWORK_ACCESS = "local-network-access" + LOOPBACK_NETWORK = "loopback-network" MAGNETOMETER = "magnetometer" + MANUAL_TEXT = "manual-text" MEDIA_PLAYBACK_WHILE_NOT_VISIBLE = "media-playback-while-not-visible" MICROPHONE = "microphone" MIDI = "midi" @@ -278,7 +222,6 @@ class PermissionsPolicyFeature(enum.Enum): OTP_CREDENTIALS = "otp-credentials" PAYMENT = "payment" PICTURE_IN_PICTURE = "picture-in-picture" - POPINS = "popins" PRIVATE_AGGREGATION = "private-aggregation" PRIVATE_STATE_TOKEN_ISSUANCE = "private-state-token-issuance" PRIVATE_STATE_TOKEN_REDEMPTION = "private-state-token-redemption" @@ -289,7 +232,6 @@ class PermissionsPolicyFeature(enum.Enum): RUN_AD_AUCTION = "run-ad-auction" SCREEN_WAKE_LOCK = "screen-wake-lock" SERIAL = "serial" - SHARED_AUTOFILL = "shared-autofill" SHARED_STORAGE = "shared-storage" SHARED_STORAGE_SELECT_URL = "shared-storage-select-url" SMART_CARD = "smart-card" @@ -1782,6 +1724,7 @@ class BackForwardCacheNotRestoredReason(enum.Enum): BACK_FORWARD_CACHE_DISABLED_FOR_PRERENDER = "BackForwardCacheDisabledForPrerender" USER_AGENT_OVERRIDE_DIFFERS = "UserAgentOverrideDiffers" FOREGROUND_CACHE_LIMIT = "ForegroundCacheLimit" + FORWARD_CACHE_DISABLED = "ForwardCacheDisabled" BROWSING_INSTANCE_NOT_SWAPPED = "BrowsingInstanceNotSwapped" BACK_FORWARD_CACHE_DISABLED_FOR_DELEGATE = "BackForwardCacheDisabledForDelegate" UNLOAD_HANDLER_EXISTS_IN_MAIN_FRAME = "UnloadHandlerExistsInMainFrame" @@ -1825,6 +1768,7 @@ class BackForwardCacheNotRestoredReason(enum.Enum): SHARED_WORKER_MESSAGE = "SharedWorkerMessage" SHARED_WORKER_WITH_NO_ACTIVE_CLIENT = "SharedWorkerWithNoActiveClient" WEB_LOCKS = "WebLocks" + WEB_LOCKS_CONTENTION = "WebLocksContention" WEB_HID = "WebHID" WEB_BLUETOOTH = "WebBluetooth" WEB_SHARE = "WebShare" @@ -2352,7 +2296,7 @@ def get_app_id() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing def get_ad_script_ancestry( frame_id: FrameId - ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[AdScriptAncestry]]: + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[network.AdAncestry]]: r''' @@ -2368,7 +2312,7 @@ def get_ad_script_ancestry( 'params': params, } json = yield cmd_dict - return AdScriptAncestry.from_json(json['adScriptAncestry']) if 'adScriptAncestry' in json else None + return network.AdAncestry.from_json(json['adScriptAncestry']) if 'adScriptAncestry' in json else None def get_frame_tree() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,FrameTree]: @@ -3392,6 +3336,29 @@ def set_prerendering_allowed( json = yield cmd_dict +def get_annotated_page_content( + include_actionable_information: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + r''' + Get the annotated page content for the main frame. + This is an experimental command that is subject to change. + + **EXPERIMENTAL** + + :param include_actionable_information: *(Optional)* Whether to include actionable information. Defaults to true. + :returns: The annotated page content as a base64 encoded protobuf. The format is defined by the ``AnnotatedPageContent`` message in components/optimization_guide/proto/features/common_quality_data.proto (Encoded as a base64 string when passed over JSON) + ''' + params: T_JSON_DICT = dict() + if include_actionable_information is not None: + params['includeActionableInformation'] = include_actionable_information + cmd_dict: T_JSON_DICT = { + 'method': 'Page.getAnnotatedPageContent', + 'params': params, + } + json = yield cmd_dict + return str(json['content']) + + @event_class('Page.domContentEventFired') @dataclass class DomContentEventFired: diff --git a/cdp/smart_card_emulation.py b/cdp/smart_card_emulation.py new file mode 100644 index 0000000..4c47ae3 --- /dev/null +++ b/cdp/smart_card_emulation.py @@ -0,0 +1,891 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: SmartCardEmulation (experimental) + +from __future__ import annotations +from cdp.util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + + +class ResultCode(enum.Enum): + r''' + Indicates the PC/SC error code. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html + Microsoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values + ''' + SUCCESS = "success" + REMOVED_CARD = "removed-card" + RESET_CARD = "reset-card" + UNPOWERED_CARD = "unpowered-card" + UNRESPONSIVE_CARD = "unresponsive-card" + UNSUPPORTED_CARD = "unsupported-card" + READER_UNAVAILABLE = "reader-unavailable" + SHARING_VIOLATION = "sharing-violation" + NOT_TRANSACTED = "not-transacted" + NO_SMARTCARD = "no-smartcard" + PROTO_MISMATCH = "proto-mismatch" + SYSTEM_CANCELLED = "system-cancelled" + NOT_READY = "not-ready" + CANCELLED = "cancelled" + INSUFFICIENT_BUFFER = "insufficient-buffer" + INVALID_HANDLE = "invalid-handle" + INVALID_PARAMETER = "invalid-parameter" + INVALID_VALUE = "invalid-value" + NO_MEMORY = "no-memory" + TIMEOUT = "timeout" + UNKNOWN_READER = "unknown-reader" + UNSUPPORTED_FEATURE = "unsupported-feature" + NO_READERS_AVAILABLE = "no-readers-available" + SERVICE_STOPPED = "service-stopped" + NO_SERVICE = "no-service" + COMM_ERROR = "comm-error" + INTERNAL_ERROR = "internal-error" + SERVER_TOO_BUSY = "server-too-busy" + UNEXPECTED = "unexpected" + SHUTDOWN = "shutdown" + UNKNOWN_CARD = "unknown-card" + UNKNOWN = "unknown" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> ResultCode: + return cls(json) + + +class ShareMode(enum.Enum): + r''' + Maps to the ``SCARD_SHARE_*`` values. + ''' + SHARED = "shared" + EXCLUSIVE = "exclusive" + DIRECT = "direct" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> ShareMode: + return cls(json) + + +class Disposition(enum.Enum): + r''' + Indicates what the reader should do with the card. + ''' + LEAVE_CARD = "leave-card" + RESET_CARD = "reset-card" + UNPOWER_CARD = "unpower-card" + EJECT_CARD = "eject-card" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> Disposition: + return cls(json) + + +class ConnectionState(enum.Enum): + r''' + Maps to ``SCARD_*`` connection state values. + ''' + ABSENT = "absent" + PRESENT = "present" + SWALLOWED = "swallowed" + POWERED = "powered" + NEGOTIABLE = "negotiable" + SPECIFIC = "specific" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> ConnectionState: + return cls(json) + + +@dataclass +class ReaderStateFlags: + r''' + Maps to the ``SCARD_STATE_*`` flags. + ''' + unaware: typing.Optional[bool] = None + + ignore: typing.Optional[bool] = None + + changed: typing.Optional[bool] = None + + unknown: typing.Optional[bool] = None + + unavailable: typing.Optional[bool] = None + + empty: typing.Optional[bool] = None + + present: typing.Optional[bool] = None + + exclusive: typing.Optional[bool] = None + + inuse: typing.Optional[bool] = None + + mute: typing.Optional[bool] = None + + unpowered: typing.Optional[bool] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + if self.unaware is not None: + json['unaware'] = self.unaware + if self.ignore is not None: + json['ignore'] = self.ignore + if self.changed is not None: + json['changed'] = self.changed + if self.unknown is not None: + json['unknown'] = self.unknown + if self.unavailable is not None: + json['unavailable'] = self.unavailable + if self.empty is not None: + json['empty'] = self.empty + if self.present is not None: + json['present'] = self.present + if self.exclusive is not None: + json['exclusive'] = self.exclusive + if self.inuse is not None: + json['inuse'] = self.inuse + if self.mute is not None: + json['mute'] = self.mute + if self.unpowered is not None: + json['unpowered'] = self.unpowered + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReaderStateFlags: + return cls( + unaware=bool(json['unaware']) if 'unaware' in json else None, + ignore=bool(json['ignore']) if 'ignore' in json else None, + changed=bool(json['changed']) if 'changed' in json else None, + unknown=bool(json['unknown']) if 'unknown' in json else None, + unavailable=bool(json['unavailable']) if 'unavailable' in json else None, + empty=bool(json['empty']) if 'empty' in json else None, + present=bool(json['present']) if 'present' in json else None, + exclusive=bool(json['exclusive']) if 'exclusive' in json else None, + inuse=bool(json['inuse']) if 'inuse' in json else None, + mute=bool(json['mute']) if 'mute' in json else None, + unpowered=bool(json['unpowered']) if 'unpowered' in json else None, + ) + + +@dataclass +class ProtocolSet: + r''' + Maps to the ``SCARD_PROTOCOL_*`` flags. + ''' + t0: typing.Optional[bool] = None + + t1: typing.Optional[bool] = None + + raw: typing.Optional[bool] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + if self.t0 is not None: + json['t0'] = self.t0 + if self.t1 is not None: + json['t1'] = self.t1 + if self.raw is not None: + json['raw'] = self.raw + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ProtocolSet: + return cls( + t0=bool(json['t0']) if 't0' in json else None, + t1=bool(json['t1']) if 't1' in json else None, + raw=bool(json['raw']) if 'raw' in json else None, + ) + + +class Protocol(enum.Enum): + r''' + Maps to the ``SCARD_PROTOCOL_*`` values. + ''' + T0 = "t0" + T1 = "t1" + RAW = "raw" + + def to_json(self) -> str: + return self.value + + @classmethod + def from_json(cls, json: str) -> Protocol: + return cls(json) + + +@dataclass +class ReaderStateIn: + reader: str + + current_state: ReaderStateFlags + + current_insertion_count: int + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['reader'] = self.reader + json['currentState'] = self.current_state.to_json() + json['currentInsertionCount'] = self.current_insertion_count + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReaderStateIn: + return cls( + reader=str(json['reader']), + current_state=ReaderStateFlags.from_json(json['currentState']), + current_insertion_count=int(json['currentInsertionCount']), + ) + + +@dataclass +class ReaderStateOut: + reader: str + + event_state: ReaderStateFlags + + event_count: int + + atr: str + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['reader'] = self.reader + json['eventState'] = self.event_state.to_json() + json['eventCount'] = self.event_count + json['atr'] = self.atr + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReaderStateOut: + return cls( + reader=str(json['reader']), + event_state=ReaderStateFlags.from_json(json['eventState']), + event_count=int(json['eventCount']), + atr=str(json['atr']), + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Enables the ``SmartCardEmulation`` domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Disables the ``SmartCardEmulation`` domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.disable', + } + json = yield cmd_dict + + +def report_establish_context_result( + request_id: str, + context_id: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardEstablishContext`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + + :param request_id: + :param context_id: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['contextId'] = context_id + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportEstablishContextResult', + 'params': params, + } + json = yield cmd_dict + + +def report_release_context_result( + request_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardReleaseContext`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + + :param request_id: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportReleaseContextResult', + 'params': params, + } + json = yield cmd_dict + + +def report_list_readers_result( + request_id: str, + readers: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardListReaders`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + + :param request_id: + :param readers: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['readers'] = [i for i in readers] + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportListReadersResult', + 'params': params, + } + json = yield cmd_dict + + +def report_get_status_change_result( + request_id: str, + reader_states: typing.List[ReaderStateOut] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardGetStatusChange`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + + :param request_id: + :param reader_states: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['readerStates'] = [i.to_json() for i in reader_states] + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportGetStatusChangeResult', + 'params': params, + } + json = yield cmd_dict + + +def report_begin_transaction_result( + request_id: str, + handle: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the result of a ``SCardBeginTransaction`` call. + On success, this creates a new transaction object. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + + :param request_id: + :param handle: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['handle'] = handle + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportBeginTransactionResult', + 'params': params, + } + json = yield cmd_dict + + +def report_plain_result( + request_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a call that returns only a result code. + Used for: ``SCardCancel``, ``SCardDisconnect``, ``SCardSetAttrib``, ``SCardEndTransaction``. + + This maps to: + 1. SCardCancel + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + + 2. SCardDisconnect + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + + 3. SCardSetAttrib + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + + 4. SCardEndTransaction + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + + :param request_id: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportPlainResult', + 'params': params, + } + json = yield cmd_dict + + +def report_connect_result( + request_id: str, + handle: int, + active_protocol: typing.Optional[Protocol] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardConnect`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + + :param request_id: + :param handle: + :param active_protocol: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['handle'] = handle + if active_protocol is not None: + params['activeProtocol'] = active_protocol.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportConnectResult', + 'params': params, + } + json = yield cmd_dict + + +def report_data_result( + request_id: str, + data: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a call that sends back data on success. + Used for ``SCardTransmit``, ``SCardControl``, and ``SCardGetAttrib``. + + This maps to: + 1. SCardTransmit + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + + 2. SCardControl + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + + 3. SCardGetAttrib + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + + :param request_id: + :param data: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['data'] = data + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportDataResult', + 'params': params, + } + json = yield cmd_dict + + +def report_status_result( + request_id: str, + reader_name: str, + state: ConnectionState, + atr: str, + protocol: typing.Optional[Protocol] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports the successful result of a ``SCardStatus`` call. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + + :param request_id: + :param reader_name: + :param state: + :param atr: + :param protocol: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['readerName'] = reader_name + params['state'] = state.to_json() + params['atr'] = atr + if protocol is not None: + params['protocol'] = protocol.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportStatusResult', + 'params': params, + } + json = yield cmd_dict + + +def report_error( + request_id: str, + result_code: ResultCode + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Reports an error result for the given request. + + :param request_id: + :param result_code: + ''' + params: T_JSON_DICT = dict() + params['requestId'] = request_id + params['resultCode'] = result_code.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'SmartCardEmulation.reportError', + 'params': params, + } + json = yield cmd_dict + + +@event_class('SmartCardEmulation.establishContextRequested') +@dataclass +class EstablishContextRequested: + r''' + Fired when ``SCardEstablishContext`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + ''' + request_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> EstablishContextRequested: + return cls( + request_id=str(json['requestId']) + ) + + +@event_class('SmartCardEmulation.releaseContextRequested') +@dataclass +class ReleaseContextRequested: + r''' + Fired when ``SCardReleaseContext`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + ''' + request_id: str + context_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReleaseContextRequested: + return cls( + request_id=str(json['requestId']), + context_id=int(json['contextId']) + ) + + +@event_class('SmartCardEmulation.listReadersRequested') +@dataclass +class ListReadersRequested: + r''' + Fired when ``SCardListReaders`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + ''' + request_id: str + context_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ListReadersRequested: + return cls( + request_id=str(json['requestId']), + context_id=int(json['contextId']) + ) + + +@event_class('SmartCardEmulation.getStatusChangeRequested') +@dataclass +class GetStatusChangeRequested: + r''' + Fired when ``SCardGetStatusChange`` is called. Timeout is specified in milliseconds. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + ''' + request_id: str + context_id: int + reader_states: typing.List[ReaderStateIn] + #: in milliseconds, if absent, it means "infinite" + timeout: typing.Optional[int] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> GetStatusChangeRequested: + return cls( + request_id=str(json['requestId']), + context_id=int(json['contextId']), + reader_states=[ReaderStateIn.from_json(i) for i in json['readerStates']], + timeout=int(json['timeout']) if 'timeout' in json else None + ) + + +@event_class('SmartCardEmulation.cancelRequested') +@dataclass +class CancelRequested: + r''' + Fired when ``SCardCancel`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + ''' + request_id: str + context_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CancelRequested: + return cls( + request_id=str(json['requestId']), + context_id=int(json['contextId']) + ) + + +@event_class('SmartCardEmulation.connectRequested') +@dataclass +class ConnectRequested: + r''' + Fired when ``SCardConnect`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + ''' + request_id: str + context_id: int + reader: str + share_mode: ShareMode + preferred_protocols: ProtocolSet + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConnectRequested: + return cls( + request_id=str(json['requestId']), + context_id=int(json['contextId']), + reader=str(json['reader']), + share_mode=ShareMode.from_json(json['shareMode']), + preferred_protocols=ProtocolSet.from_json(json['preferredProtocols']) + ) + + +@event_class('SmartCardEmulation.disconnectRequested') +@dataclass +class DisconnectRequested: + r''' + Fired when ``SCardDisconnect`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + ''' + request_id: str + handle: int + disposition: Disposition + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DisconnectRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + disposition=Disposition.from_json(json['disposition']) + ) + + +@event_class('SmartCardEmulation.transmitRequested') +@dataclass +class TransmitRequested: + r''' + Fired when ``SCardTransmit`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + ''' + request_id: str + handle: int + data: str + protocol: typing.Optional[Protocol] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TransmitRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + data=str(json['data']), + protocol=Protocol.from_json(json['protocol']) if 'protocol' in json else None + ) + + +@event_class('SmartCardEmulation.controlRequested') +@dataclass +class ControlRequested: + r''' + Fired when ``SCardControl`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + ''' + request_id: str + handle: int + control_code: int + data: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ControlRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + control_code=int(json['controlCode']), + data=str(json['data']) + ) + + +@event_class('SmartCardEmulation.getAttribRequested') +@dataclass +class GetAttribRequested: + r''' + Fired when ``SCardGetAttrib`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + ''' + request_id: str + handle: int + attrib_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> GetAttribRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + attrib_id=int(json['attribId']) + ) + + +@event_class('SmartCardEmulation.setAttribRequested') +@dataclass +class SetAttribRequested: + r''' + Fired when ``SCardSetAttrib`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + ''' + request_id: str + handle: int + attrib_id: int + data: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SetAttribRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + attrib_id=int(json['attribId']), + data=str(json['data']) + ) + + +@event_class('SmartCardEmulation.statusRequested') +@dataclass +class StatusRequested: + r''' + Fired when ``SCardStatus`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + ''' + request_id: str + handle: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StatusRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']) + ) + + +@event_class('SmartCardEmulation.beginTransactionRequested') +@dataclass +class BeginTransactionRequested: + r''' + Fired when ``SCardBeginTransaction`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + ''' + request_id: str + handle: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BeginTransactionRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']) + ) + + +@event_class('SmartCardEmulation.endTransactionRequested') +@dataclass +class EndTransactionRequested: + r''' + Fired when ``SCardEndTransaction`` is called. + + This maps to: + PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + ''' + request_id: str + handle: int + disposition: Disposition + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> EndTransactionRequested: + return cls( + request_id=str(json['requestId']), + handle=int(json['handle']), + disposition=Disposition.from_json(json['disposition']) + ) diff --git a/cdp/target.py b/cdp/target.py index 856816d..b4e7263 100644 --- a/cdp/target.py +++ b/cdp/target.py @@ -337,17 +337,23 @@ def create_browser_context( return browser.BrowserContextID.from_json(json['browserContextId']) -def get_browser_contexts() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[browser.BrowserContextID]]: +def get_browser_contexts() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[browser.BrowserContextID], typing.Optional[browser.BrowserContextID]]]: r''' Returns all browser contexts created with ``Target.createBrowserContext`` method. - :returns: An array of browser context ids. + :returns: A tuple with the following items: + + 0. **browserContextIds** - An array of browser context ids. + 1. **defaultBrowserContextId** - *(Optional)* The id of the default browser context if available. ''' cmd_dict: T_JSON_DICT = { 'method': 'Target.getBrowserContexts', } json = yield cmd_dict - return [browser.BrowserContextID.from_json(i) for i in json['browserContextIds']] + return ( + [browser.BrowserContextID.from_json(i) for i in json['browserContextIds']], + browser.BrowserContextID.from_json(json['defaultBrowserContextId']) if 'defaultBrowserContextId' in json else None + ) def create_target( @@ -362,7 +368,8 @@ def create_target( new_window: typing.Optional[bool] = None, background: typing.Optional[bool] = None, for_tab: typing.Optional[bool] = None, - hidden: typing.Optional[bool] = None + hidden: typing.Optional[bool] = None, + focus: typing.Optional[bool] = None ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetID]: r''' Creates a new page. @@ -379,6 +386,7 @@ def create_target( :param background: *(Optional)* Whether to create the target in background or foreground (false by default, not supported by headless shell). :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab". :param hidden: **(EXPERIMENTAL)** *(Optional)* Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with ```forTab: true````, ````newWindow: true```` or ````background: false```. The life-time of the tab is limited to the life-time of the session. + :param focus: **(EXPERIMENTAL)** *(Optional)* If specified, the option is used to determine if the new target should be focused or not. By default, the focus behavior depends on the value of the background field. For example, background=false and focus=false will result in the target tab being opened but the browser window remain unchanged (if it was in the background, it will remain in the background) and background=false with focus=undefined will result in the window being focused. Using background: true and focus: true is not supported and will result in an error. :returns: The id of the page opened. ''' params: T_JSON_DICT = dict() @@ -405,6 +413,8 @@ def create_target( params['forTab'] = for_tab if hidden is not None: params['hidden'] = hidden + if focus is not None: + params['focus'] = focus cmd_dict: T_JSON_DICT = { 'method': 'Target.createTarget', 'params': params, @@ -632,6 +642,28 @@ def set_remote_locations( json = yield cmd_dict +def get_dev_tools_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[TargetID]]: + r''' + Gets the targetId of the DevTools page target opened for the given target + (if any). + + **EXPERIMENTAL** + + :param target_id: Page or tab target ID. + :returns: *(Optional)* The targetId of DevTools page target if exists. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getDevToolsTarget', + 'params': params, + } + json = yield cmd_dict + return TargetID.from_json(json['targetId']) if 'targetId' in json else None + + def open_dev_tools( target_id: TargetID, panel_id: typing.Optional[str] = None @@ -642,7 +674,7 @@ def open_dev_tools( **EXPERIMENTAL** :param target_id: This can be the page or tab target ID. - :param panel_id: *(Optional)* The id of the panel we want DevTools to open initially. Currently supported panels are elements, console, network, sources and resources. + :param panel_id: *(Optional)* The id of the panel we want DevTools to open initially. Currently supported panels are elements, console, network, sources, resources and performance. :returns: The targetId of DevTools page target. ''' params: T_JSON_DICT = dict() diff --git a/cdp/tracing.py b/cdp/tracing.py index 14f6308..f9ca828 100644 --- a/cdp/tracing.py +++ b/cdp/tracing.py @@ -190,6 +190,21 @@ def get_categories() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str return [str(i) for i in json['categories']] +def get_track_event_descriptor() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + r''' + Return a descriptor for all available tracing categories. + + **EXPERIMENTAL** + + :returns: Base64-encoded serialized perfetto.protos.TrackEventDescriptor protobuf message. (Encoded as a base64 string when passed over JSON) + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.getTrackEventDescriptor', + } + json = yield cmd_dict + return str(json['descriptor']) + + def record_clock_sync_marker( sync_id: str ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: diff --git a/cdp/web_mcp.py b/cdp/web_mcp.py new file mode 100644 index 0000000..b1e639d --- /dev/null +++ b/cdp/web_mcp.py @@ -0,0 +1,140 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebMCP (experimental) + +from __future__ import annotations +from cdp.util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +from . import dom +from . import page +from . import runtime + + +@dataclass +class Annotation: + r''' + Tool annotations + ''' + #: A hint indicating that the tool does not modify any state. + read_only: typing.Optional[bool] = None + + #: If the declarative tool was declared with the autosubmit attribute. + autosubmit: typing.Optional[bool] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + if self.read_only is not None: + json['readOnly'] = self.read_only + if self.autosubmit is not None: + json['autosubmit'] = self.autosubmit + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Annotation: + return cls( + read_only=bool(json['readOnly']) if 'readOnly' in json else None, + autosubmit=bool(json['autosubmit']) if 'autosubmit' in json else None, + ) + + +@dataclass +class Tool: + r''' + Definition of a tool that can be invoked. + ''' + #: Tool name. + name: str + + #: Tool description. + description: str + + #: Frame identifier associated with the tool registration. + frame_id: page.FrameId + + #: Schema for the tool's input parameters. + input_schema: typing.Optional[dict] = None + + #: Optional annotations for the tool. + annotations: typing.Optional[Annotation] = None + + #: Optional node ID for declarative tools. + backend_node_id: typing.Optional[dom.BackendNodeId] = None + + #: The stack trace at the time of the registration. + stack_trace: typing.Optional[runtime.StackTrace] = None + + def to_json(self) -> T_JSON_DICT: + json: T_JSON_DICT = dict() + json['name'] = self.name + json['description'] = self.description + json['frameId'] = self.frame_id.to_json() + if self.input_schema is not None: + json['inputSchema'] = self.input_schema + if self.annotations is not None: + json['annotations'] = self.annotations.to_json() + if self.backend_node_id is not None: + json['backendNodeId'] = self.backend_node_id.to_json() + if self.stack_trace is not None: + json['stackTrace'] = self.stack_trace.to_json() + return json + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Tool: + return cls( + name=str(json['name']), + description=str(json['description']), + frame_id=page.FrameId.from_json(json['frameId']), + input_schema=dict(json['inputSchema']) if 'inputSchema' in json else None, + annotations=Annotation.from_json(json['annotations']) if 'annotations' in json else None, + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) if 'backendNodeId' in json else None, + stack_trace=runtime.StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + r''' + Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for + all currently registered tools. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebMCP.enable', + } + json = yield cmd_dict + + +@event_class('WebMCP.toolsAdded') +@dataclass +class ToolsAdded: + r''' + Event fired when new tools are added. + ''' + #: Array of tools that were added. + tools: typing.List[Tool] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ToolsAdded: + return cls( + tools=[Tool.from_json(i) for i in json['tools']] + ) + + +@event_class('WebMCP.toolsRemoved') +@dataclass +class ToolsRemoved: + r''' + Event fired when tools are removed. + ''' + #: Array of tools that were removed. + tools: typing.List[Tool] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ToolsRemoved: + return cls( + tools=[Tool.from_json(i) for i in json['tools']] + ) diff --git a/docs/api/audits.rst b/docs/api/audits.rst index 58ffba2..d75e16f 100644 --- a/docs/api/audits.rst +++ b/docs/api/audits.rst @@ -64,6 +64,16 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: PerformanceIssueType + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: PerformanceIssueDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: MixedContentResolutionStatus :members: :undoc-members: @@ -129,11 +139,6 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json -.. autoclass:: LowTextContrastIssueDetails - :members: - :undoc-members: - :exclude-members: from_json, to_json - .. autoclass:: CorsIssueDetails :members: :undoc-members: @@ -159,6 +164,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: ConnectionAllowlistError + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: AttributionReportingIssueDetails :members: :undoc-members: @@ -189,6 +199,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: ConnectionAllowlistIssueDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: GenericIssueErrorType :members: :undoc-members: @@ -299,6 +314,21 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: PermissionElementIssueType + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: PermissionElementIssueDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: SelectivePermissionsInterventionIssueDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: InspectorIssueCode :members: :undoc-members: @@ -331,8 +361,6 @@ commands, and ``z`` is the return type you should pay attention to. For more information, see :ref:`Getting Started: Commands `. -.. autofunction:: check_contrast - .. autofunction:: check_forms_issues .. autofunction:: disable diff --git a/docs/api/css.rst b/docs/api/css.rst index 469ffba..d83a57f 100644 --- a/docs/api/css.rst +++ b/docs/api/css.rst @@ -24,11 +24,6 @@ yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands. -.. autoclass:: StyleSheetId - :members: - :undoc-members: - :exclude-members: from_json, to_json - .. autoclass:: StyleSheetOrigin :members: :undoc-members: @@ -154,6 +149,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: CSSNavigation + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: CSSScope :members: :undoc-members: @@ -209,11 +209,6 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json -.. autoclass:: CSSFontPaletteValuesRule - :members: - :undoc-members: - :exclude-members: from_json, to_json - .. autoclass:: CSSAtRule :members: :undoc-members: @@ -316,6 +311,8 @@ to. For more information, see .. autofunction:: set_media_text +.. autofunction:: set_navigation_text + .. autofunction:: set_property_rule_property_name .. autofunction:: set_rule_selector diff --git a/docs/api/dom.rst b/docs/api/dom.rst index dcf5d14..c75ec1b 100644 --- a/docs/api/dom.rst +++ b/docs/api/dom.rst @@ -33,6 +33,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: StyleSheetId + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: BackendNode :members: :undoc-members: @@ -238,6 +243,11 @@ you use the event's attributes. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: AdoptedStyleSheetsModified + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: AttributeRemoved :members: :undoc-members: @@ -293,6 +303,11 @@ you use the event's attributes. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: AdRelatedStateUpdated + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: AffectedByStartingStylesFlagUpdated :members: :undoc-members: diff --git a/docs/api/emulation.rst b/docs/api/emulation.rst index 99f298c..f816ab1 100644 --- a/docs/api/emulation.rst +++ b/docs/api/emulation.rst @@ -204,6 +204,8 @@ to. For more information, see .. autofunction:: set_pressure_state_override +.. autofunction:: set_primary_screen + .. autofunction:: set_safe_area_insets_override .. autofunction:: set_script_execution_disabled @@ -226,6 +228,8 @@ to. For more information, see .. autofunction:: set_visible_size +.. autofunction:: update_screen + Events ------ @@ -237,3 +241,8 @@ you use the event's attributes. :members: :undoc-members: :exclude-members: from_json, to_json + +.. autoclass:: ScreenOrientationLockChanged + :members: + :undoc-members: + :exclude-members: from_json, to_json diff --git a/docs/api/extensions.rst b/docs/api/extensions.rst index ef7538d..8c55c98 100644 --- a/docs/api/extensions.rst +++ b/docs/api/extensions.rst @@ -24,6 +24,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: ExtensionInfo + :members: + :undoc-members: + :exclude-members: from_json, to_json + Commands -------- @@ -38,6 +43,8 @@ to. For more information, see .. autofunction:: clear_storage_items +.. autofunction:: get_extensions + .. autofunction:: get_storage_items .. autofunction:: load_unpacked @@ -46,6 +53,8 @@ to. For more information, see .. autofunction:: set_storage_items +.. autofunction:: trigger_action + .. autofunction:: uninstall Events diff --git a/docs/api/network.rst b/docs/api/network.rst index 9b14548..a9ccdf5 100644 --- a/docs/api/network.rst +++ b/docs/api/network.rst @@ -88,6 +88,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: RenderBlockingBehavior + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: PostDataEntry :members: :undoc-members: @@ -118,11 +123,6 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json -.. autoclass:: IpProxyStatus - :members: - :undoc-members: - :exclude-members: from_json, to_json - .. autoclass:: CorsError :members: :undoc-members: @@ -318,7 +318,7 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json -.. autoclass:: PrivateNetworkRequestPolicy +.. autoclass:: LocalNetworkAccessRequestPolicy :members: :undoc-members: :exclude-members: from_json, to_json @@ -338,6 +338,16 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: AdScriptIdentifier + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: AdAncestry + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: CrossOriginOpenerPolicyValue :members: :undoc-members: @@ -393,6 +403,71 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: DeviceBoundSessionKey + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionWithUsage + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionCookieCraving + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionUrlRule + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionInclusionRules + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSession + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionEventId + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionFetchResult + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionFailedRequest + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: CreationEventDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: RefreshEventDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: TerminationEventDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ChallengeEventDetails + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: LoadNetworkResourcePageResult :members: :undoc-members: @@ -427,6 +502,8 @@ to. For more information, see .. autofunction:: clear_browser_cookies +.. autofunction:: configure_durable_messages + .. autofunction:: continue_intercepted_request .. autofunction:: delete_cookies @@ -439,16 +516,18 @@ to. For more information, see .. autofunction:: enable +.. autofunction:: enable_device_bound_sessions + .. autofunction:: enable_reporting_api +.. autofunction:: fetch_schemeful_site + .. autofunction:: get_all_cookies .. autofunction:: get_certificate .. autofunction:: get_cookies -.. autofunction:: get_ip_protection_proxy_status - .. autofunction:: get_request_post_data .. autofunction:: get_response_body @@ -483,8 +562,6 @@ to. For more information, see .. autofunction:: set_extra_http_headers -.. autofunction:: set_ip_protection_proxy_bypass_enabled - .. autofunction:: set_request_interception .. autofunction:: set_user_agent_override @@ -630,6 +707,16 @@ you use the event's attributes. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: DirectUDPSocketJoinedMulticastGroup + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DirectUDPSocketLeftMulticastGroup + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: DirectUDPSocketCreated :members: :undoc-members: @@ -699,3 +786,13 @@ you use the event's attributes. :members: :undoc-members: :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionsAdded + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DeviceBoundSessionEventOccurred + :members: + :undoc-members: + :exclude-members: from_json, to_json diff --git a/docs/api/overlay.rst b/docs/api/overlay.rst index accba4b..0e2da17 100644 --- a/docs/api/overlay.rst +++ b/docs/api/overlay.rst @@ -119,6 +119,11 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: InspectedElementAnchorConfig + :members: + :undoc-members: + :exclude-members: from_json, to_json + Commands -------- @@ -173,6 +178,8 @@ to. For more information, see .. autofunction:: set_show_hit_test_borders +.. autofunction:: set_show_inspected_element_anchor + .. autofunction:: set_show_isolated_elements .. autofunction:: set_show_layout_shift_regions @@ -211,6 +218,16 @@ you use the event's attributes. :undoc-members: :exclude-members: from_json, to_json +.. autoclass:: InspectPanelShowRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: InspectedElementWindowRestored + :members: + :undoc-members: + :exclude-members: from_json, to_json + .. autoclass:: InspectModeCanceled :members: :undoc-members: diff --git a/docs/api/page.rst b/docs/api/page.rst index eadf346..f131729 100644 --- a/docs/api/page.rst +++ b/docs/api/page.rst @@ -37,16 +37,6 @@ arguments to other commands. :undoc-members: :exclude-members: from_json, to_json -.. autoclass:: AdScriptId - :members: - :undoc-members: - :exclude-members: from_json, to_json - -.. autoclass:: AdScriptAncestry - :members: - :undoc-members: - :exclude-members: from_json, to_json - .. autoclass:: SecureContextType :members: :undoc-members: @@ -365,6 +355,8 @@ to. For more information, see .. autofunction:: get_ad_script_ancestry +.. autofunction:: get_annotated_page_content + .. autofunction:: get_app_id .. autofunction:: get_app_manifest diff --git a/docs/api/smart_card_emulation.rst b/docs/api/smart_card_emulation.rst new file mode 100644 index 0000000..c267299 --- /dev/null +++ b/docs/api/smart_card_emulation.rst @@ -0,0 +1,176 @@ +SmartCardEmulation +================== + +*This CDP domain is experimental.* + +.. module:: cdp.smart_card_emulation + +* Types_ +* Commands_ +* Events_ + +Types +----- + +Generally, you do not need to instantiate CDP types +yourself. Instead, the API creates objects for you as return +values from commands, and then you can use those objects as +arguments to other commands. + +.. autoclass:: ResultCode + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ShareMode + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: Disposition + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ConnectionState + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ReaderStateFlags + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ProtocolSet + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: Protocol + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ReaderStateIn + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ReaderStateOut + :members: + :undoc-members: + :exclude-members: from_json, to_json + +Commands +-------- + +Each command is a generator function. The return +type ``Generator[x, y, z]`` indicates that the generator +*yields* arguments of type ``x``, it must be resumed with +an argument of type ``y``, and it returns type ``z``. In +this library, types ``x`` and ``y`` are the same for all +commands, and ``z`` is the return type you should pay attention +to. For more information, see +:ref:`Getting Started: Commands `. + +.. autofunction:: disable + +.. autofunction:: enable + +.. autofunction:: report_begin_transaction_result + +.. autofunction:: report_connect_result + +.. autofunction:: report_data_result + +.. autofunction:: report_error + +.. autofunction:: report_establish_context_result + +.. autofunction:: report_get_status_change_result + +.. autofunction:: report_list_readers_result + +.. autofunction:: report_plain_result + +.. autofunction:: report_release_context_result + +.. autofunction:: report_status_result + +Events +------ + +Generally, you do not need to instantiate CDP events +yourself. Instead, the API creates events for you and then +you use the event's attributes. + +.. autoclass:: EstablishContextRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ReleaseContextRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ListReadersRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: GetStatusChangeRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: CancelRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ConnectRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: DisconnectRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: TransmitRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ControlRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: GetAttribRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: SetAttribRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: StatusRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: BeginTransactionRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: EndTransactionRequested + :members: + :undoc-members: + :exclude-members: from_json, to_json diff --git a/docs/api/target.rst b/docs/api/target.rst index 31f213d..0bef803 100644 --- a/docs/api/target.rst +++ b/docs/api/target.rst @@ -86,6 +86,8 @@ to. For more information, see .. autofunction:: get_browser_contexts +.. autofunction:: get_dev_tools_target + .. autofunction:: get_target_info .. autofunction:: get_targets diff --git a/docs/api/tracing.rst b/docs/api/tracing.rst index ea7a0e5..b56021e 100644 --- a/docs/api/tracing.rst +++ b/docs/api/tracing.rst @@ -61,6 +61,8 @@ to. For more information, see .. autofunction:: get_categories +.. autofunction:: get_track_event_descriptor + .. autofunction:: record_clock_sync_marker .. autofunction:: request_memory_dump diff --git a/docs/api/web_mcp.rst b/docs/api/web_mcp.rst new file mode 100644 index 0000000..327ebc3 --- /dev/null +++ b/docs/api/web_mcp.rst @@ -0,0 +1,59 @@ +WebMCP +====== + +*This CDP domain is experimental.* + +.. module:: cdp.web_mcp + +* Types_ +* Commands_ +* Events_ + +Types +----- + +Generally, you do not need to instantiate CDP types +yourself. Instead, the API creates objects for you as return +values from commands, and then you can use those objects as +arguments to other commands. + +.. autoclass:: Annotation + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: Tool + :members: + :undoc-members: + :exclude-members: from_json, to_json + +Commands +-------- + +Each command is a generator function. The return +type ``Generator[x, y, z]`` indicates that the generator +*yields* arguments of type ``x``, it must be resumed with +an argument of type ``y``, and it returns type ``z``. In +this library, types ``x`` and ``y`` are the same for all +commands, and ``z`` is the return type you should pay attention +to. For more information, see +:ref:`Getting Started: Commands `. + +.. autofunction:: enable + +Events +------ + +Generally, you do not need to instantiate CDP events +yourself. Instead, the API creates events for you and then +you use the event's attributes. + +.. autoclass:: ToolsAdded + :members: + :undoc-members: + :exclude-members: from_json, to_json + +.. autoclass:: ToolsRemoved + :members: + :undoc-members: + :exclude-members: from_json, to_json diff --git a/generator/browser_protocol.json b/generator/browser_protocol.json index 70559ec..ed4240f 100644 --- a/generator/browser_protocol.json +++ b/generator/browser_protocol.json @@ -1004,7 +1004,8 @@ "description": "Audits domain allows investigation of page violations and possible improvements.", "experimental": true, "dependencies": [ - "Network" + "Network", + "Runtime" ], "types": [ { @@ -1063,8 +1064,6 @@ "ExcludeSameSiteNoneInsecure", "ExcludeSameSiteLax", "ExcludeSameSiteStrict", - "ExcludeInvalidSameParty", - "ExcludeSamePartyCrossPartyContext", "ExcludeDomainNonASCII", "ExcludeThirdPartyCookieBlockedInFirstPartySet", "ExcludeThirdPartyPhaseout", @@ -1185,6 +1184,29 @@ } ] }, + { + "id": "PerformanceIssueType", + "type": "string", + "enum": [ + "DocumentCookie" + ] + }, + { + "id": "PerformanceIssueDetails", + "description": "Details for a performance issue.", + "type": "object", + "properties": [ + { + "name": "performanceIssueType", + "$ref": "PerformanceIssueType" + }, + { + "name": "sourceCodeLocation", + "optional": true, + "$ref": "SourceCodeLocation" + } + ] + }, { "id": "MixedContentResolutionStatus", "type": "string", @@ -1449,40 +1471,6 @@ } ] }, - { - "id": "LowTextContrastIssueDetails", - "type": "object", - "properties": [ - { - "name": "violatingNodeId", - "$ref": "DOM.BackendNodeId" - }, - { - "name": "violatingNodeSelector", - "type": "string" - }, - { - "name": "contrastRatio", - "type": "number" - }, - { - "name": "thresholdAA", - "type": "number" - }, - { - "name": "thresholdAAA", - "type": "number" - }, - { - "name": "fontSize", - "type": "string" - }, - { - "name": "fontWeight", - "type": "string" - } - ] - }, { "id": "CorsIssueDetails", "description": "Details for a CORS related issue, e.g. a warning or error related to\nCORS RFC1918 enforcement.", @@ -1617,6 +1605,18 @@ "IncorrectDigestLength" ] }, + { + "id": "ConnectionAllowlistError", + "type": "string", + "enum": [ + "InvalidHeader", + "MoreThanOneList", + "ItemNotInnerList", + "InvalidAllowlistItemType", + "ReportingEndpointNotToken", + "InvalidUrlPattern" + ] + }, { "id": "AttributionReportingIssueDetails", "description": "Details for issues around \"Attribution Reporting API\" usage.\nExplainer: https://github.com/WICG/attribution-reporting-api", @@ -1740,6 +1740,20 @@ } ] }, + { + "id": "ConnectionAllowlistIssueDetails", + "type": "object", + "properties": [ + { + "name": "error", + "$ref": "ConnectionAllowlistError" + }, + { + "name": "request", + "$ref": "AffectedRequest" + } + ] + }, { "id": "GenericIssueErrorType", "type": "string", @@ -1749,12 +1763,17 @@ "FormInputWithNoLabelError", "FormAutocompleteAttributeEmptyError", "FormEmptyIdAndNameAttributesForInputError", - "FormAriaLabelledByToNonExistingId", + "FormAriaLabelledByToNonExistingIdError", "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", - "FormLabelHasNeitherForNorNestedInput", + "FormLabelHasNeitherForNorNestedInputError", "FormLabelForMatchesNonExistingIdError", "FormInputHasWrongButWellIntendedAutocompleteValueError", - "ResponseWasBlockedByORB" + "ResponseWasBlockedByORB", + "NavigationEntryMarkedSkippable", + "AutofillAndManualTextPolicyControlledFeaturesInfo", + "AutofillPolicyControlledFeatureInfo", + "ManualTextPolicyControlledFeatureInfo", + "FormModelContextParameterMissingTitleAndDescription" ] }, { @@ -1886,10 +1905,6 @@ "ConfigNoResponse", "ConfigInvalidResponse", "ConfigInvalidContentType", - "ClientMetadataHttpNotFound", - "ClientMetadataNoResponse", - "ClientMetadataInvalidResponse", - "ClientMetadataInvalidContentType", "IdpNotPotentiallyTrustworthy", "DisabledInSettings", "DisabledInFlags", @@ -1911,11 +1926,9 @@ "Canceled", "RpPageNotVisible", "SilentMediationFailure", - "ThirdPartyCookiesBlocked", "NotSignedInWithIdp", "MissingTransientUserActivation", "ReplacedByActiveMode", - "InvalidFieldsSpecified", "RelyingPartyOriginIsOpaque", "TypeNotMatching", "UiDismissedNoEmbargo", @@ -2136,6 +2149,109 @@ } ] }, + { + "id": "PermissionElementIssueType", + "type": "string", + "enum": [ + "InvalidType", + "FencedFrameDisallowed", + "CspFrameAncestorsMissing", + "PermissionsPolicyBlocked", + "PaddingRightUnsupported", + "PaddingBottomUnsupported", + "InsetBoxShadowUnsupported", + "RequestInProgress", + "UntrustedEvent", + "RegistrationFailed", + "TypeNotSupported", + "InvalidTypeActivation", + "SecurityChecksFailed", + "ActivationDisabled", + "GeolocationDeprecated", + "InvalidDisplayStyle", + "NonOpaqueColor", + "LowContrast", + "FontSizeTooSmall", + "FontSizeTooLarge", + "InvalidSizeValue" + ] + }, + { + "id": "PermissionElementIssueDetails", + "description": "This issue warns about improper usage of the element.", + "type": "object", + "properties": [ + { + "name": "issueType", + "$ref": "PermissionElementIssueType" + }, + { + "name": "type", + "description": "The value of the type attribute.", + "optional": true, + "type": "string" + }, + { + "name": "nodeId", + "description": "The node ID of the element.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "isWarning", + "description": "True if the issue is a warning, false if it is an error.", + "optional": true, + "type": "boolean" + }, + { + "name": "permissionName", + "description": "Fields for message construction:\nUsed for messages that reference a specific permission name", + "optional": true, + "type": "string" + }, + { + "name": "occluderNodeInfo", + "description": "Used for messages about occlusion", + "optional": true, + "type": "string" + }, + { + "name": "occluderParentNodeInfo", + "description": "Used for messages about occluder's parent", + "optional": true, + "type": "string" + }, + { + "name": "disableReason", + "description": "Used for messages about activation disabled reason", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "SelectivePermissionsInterventionIssueDetails", + "description": "The issue warns about blocked calls to privacy sensitive APIs via the\nSelective Permissions Intervention.", + "type": "object", + "properties": [ + { + "name": "apiName", + "description": "Which API was intervened on.", + "type": "string" + }, + { + "name": "adAncestry", + "description": "Why the ad script using the API is considered an ad.", + "$ref": "Network.AdAncestry" + }, + { + "name": "stackTrace", + "description": "The stack trace at the time of the intervention.", + "optional": true, + "$ref": "Runtime.StackTrace" + } + ] + }, { "id": "InspectorIssueCode", "description": "A unique identifier for the type of issue. Each type may use one of the\noptional fields in InspectorIssueDetails to convey more specific\ninformation about the kind of issue.", @@ -2147,7 +2263,6 @@ "HeavyAdIssue", "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", - "LowTextContrastIssue", "CorsIssue", "AttributionReportingIssue", "QuirksModeIssue", @@ -2166,7 +2281,11 @@ "ElementAccessibilityIssue", "SRIMessageSignatureIssue", "UnencodedDigestIssue", - "UserReidentificationIssue" + "ConnectionAllowlistIssue", + "UserReidentificationIssue", + "PermissionElementIssue", + "PerformanceIssue", + "SelectivePermissionsInterventionIssue" ] }, { @@ -2204,11 +2323,6 @@ "optional": true, "$ref": "SharedArrayBufferIssueDetails" }, - { - "name": "lowTextContrastIssueDetails", - "optional": true, - "$ref": "LowTextContrastIssueDetails" - }, { "name": "corsIssueDetails", "optional": true, @@ -2300,10 +2414,30 @@ "optional": true, "$ref": "UnencodedDigestIssueDetails" }, + { + "name": "connectionAllowlistIssueDetails", + "optional": true, + "$ref": "ConnectionAllowlistIssueDetails" + }, { "name": "userReidentificationIssueDetails", "optional": true, "$ref": "UserReidentificationIssueDetails" + }, + { + "name": "permissionElementIssueDetails", + "optional": true, + "$ref": "PermissionElementIssueDetails" + }, + { + "name": "performanceIssueDetails", + "optional": true, + "$ref": "PerformanceIssueDetails" + }, + { + "name": "selectivePermissionsInterventionIssueDetails", + "optional": true, + "$ref": "SelectivePermissionsInterventionIssueDetails" } ] }, @@ -2394,18 +2528,6 @@ "name": "enable", "description": "Enables issues domain, sends the issues collected so far to the client by means of the\n`issueAdded` event." }, - { - "name": "checkContrast", - "description": "Runs the contrast check for the target page. Found issues are reported\nusing Audits.issueAdded event.", - "parameters": [ - { - "name": "reportAAA", - "description": "Whether to report WCAG AAA level issues. Default is false.", - "optional": true, - "type": "boolean" - } - ] - }, { "name": "checkFormsIssues", "description": "Runs the form issues check for the target page. Found issues are reported\nusing Audits.issueAdded event.", @@ -3379,7 +3501,9 @@ "idleDetection", "keyboardLock", "localFonts", + "localNetwork", "localNetworkAccess", + "loopbackNetwork", "midi", "midiSysex", "nfc", @@ -4000,10 +4124,6 @@ "Page" ], "types": [ - { - "id": "StyleSheetId", - "type": "string" - }, { "id": "StyleSheetOrigin", "description": "Stylesheet type: \"injected\" for stylesheets injected via extension, \"user-agent\" for user-agent\nstylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding the \"via\ninspector\" rules), \"regular\" for regular stylesheets.", @@ -4213,7 +4333,7 @@ { "name": "styleSheetId", "description": "The stylesheet identifier.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "frameId", @@ -4316,7 +4436,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "selectorList", @@ -4418,6 +4538,16 @@ "items": { "$ref": "CSSStartingStyle" } + }, + { + "name": "navigations", + "description": "@navigation CSS at-rule array.\nThe array enumerates @navigation at-rules starting with the innermost one, going outwards.", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "CSSNavigation" + } } ] }, @@ -4433,7 +4563,8 @@ "LayerRule", "ScopeRule", "StyleRule", - "StartingStyleRule" + "StartingStyleRule", + "NavigationRule" ] }, { @@ -4444,7 +4575,7 @@ { "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "startOffset", @@ -4549,7 +4680,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "cssProperties", @@ -4681,7 +4812,7 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "mediaList", @@ -4769,7 +4900,7 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "name", @@ -4829,7 +4960,38 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" + } + ] + }, + { + "id": "CSSNavigation", + "description": "CSS Navigation at-rule descriptor.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "text", + "description": "Navigation rule text.", + "type": "string" + }, + { + "name": "active", + "description": "Whether the navigation condition is satisfied.", + "optional": true, + "type": "boolean" + }, + { + "name": "range", + "description": "The associated rule header range in the enclosing stylesheet (if\navailable).", + "optional": true, + "$ref": "SourceRange" + }, + { + "name": "styleSheetId", + "description": "Identifier of the stylesheet containing this object (if exists).", + "optional": true, + "$ref": "DOM.StyleSheetId" } ] }, @@ -4854,7 +5016,7 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -4879,7 +5041,7 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -4899,7 +5061,7 @@ "name": "styleSheetId", "description": "Identifier of the stylesheet containing this object (if exists).", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -5059,7 +5221,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5087,7 +5249,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5149,34 +5311,6 @@ } ] }, - { - "id": "CSSFontPaletteValuesRule", - "description": "CSS font-palette-values rule representation.", - "type": "object", - "properties": [ - { - "name": "styleSheetId", - "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", - "optional": true, - "$ref": "StyleSheetId" - }, - { - "name": "origin", - "description": "Parent stylesheet's origin.", - "$ref": "StyleSheetOrigin" - }, - { - "name": "fontPaletteName", - "description": "Associated font palette name.", - "$ref": "Value" - }, - { - "name": "style", - "description": "Associated style declaration.", - "$ref": "CSSStyle" - } - ] - }, { "id": "CSSAtRule", "description": "CSS generic @rule representation.", @@ -5216,7 +5350,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5239,7 +5373,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5298,6 +5432,12 @@ "optional": true, "$ref": "CSSSupports" }, + { + "name": "navigation", + "description": "@navigation condition. Only one type of condition should be set.", + "optional": true, + "$ref": "CSSNavigation" + }, { "name": "children", "description": "Block body.", @@ -5346,7 +5486,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5380,7 +5520,7 @@ "name": "styleSheetId", "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified\nstylesheet rules) this rule came from.", "optional": true, - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "origin", @@ -5407,7 +5547,7 @@ { "name": "styleSheetId", "description": "The css style sheet identifier.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -5430,7 +5570,7 @@ { "name": "styleSheetId", "description": "The css style sheet identifier where a new rule should be inserted.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "ruleText", @@ -5464,7 +5604,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ], "returns": [ @@ -5498,7 +5638,7 @@ { "name": "styleSheetId", "description": "Identifier of the created \"via-inspector\" stylesheet.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -5606,7 +5746,7 @@ }, { "name": "resolveValues", - "description": "Resolve the specified values in the context of the provided element.\nFor example, a value of '1em' is evaluated according to the computed\n'font-size' of the element and a value 'calc(1px + 2px)' will be\nresolved to '3px'.\nIf the `propertyName` was specified the `values` are resolved as if\nthey were property's declaration. If a value cannot be parsed according\nto the provided property syntax, the value is parsed using combined\nsyntax as if null `propertyName` was provided. If the value cannot be\nresolved even then, return the provided value without any changes.", + "description": "Resolve the specified values in the context of the provided element.\nFor example, a value of '1em' is evaluated according to the computed\n'font-size' of the element and a value 'calc(1px + 2px)' will be\nresolved to '3px'.\nIf the `propertyName` was specified the `values` are resolved as if\nthey were property's declaration. If a value cannot be parsed according\nto the provided property syntax, the value is parsed using combined\nsyntax as if null `propertyName` was provided. If the value cannot be\nresolved even then, return the provided value without any changes.\nNote: this function currently does not resolve CSS random() function,\nit returns unmodified random() function parts.`", "experimental": true, "parameters": [ { @@ -5835,12 +5975,6 @@ "$ref": "CSSPropertyRegistration" } }, - { - "name": "cssFontPaletteValuesRule", - "description": "A font-palette-values rule matching this node.", - "optional": true, - "$ref": "CSSFontPaletteValuesRule" - }, { "name": "cssAtRules", "description": "A list of simple @rules matching this node or its pseudo-elements.", @@ -5919,7 +6053,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ], "returns": [ @@ -5954,7 +6088,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "selectorText", @@ -6037,7 +6171,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6062,7 +6196,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6087,7 +6221,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6113,7 +6247,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6139,7 +6273,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6158,6 +6292,32 @@ } ] }, + { + "name": "setNavigationText", + "description": "Modifies the expression of a navigation at-rule.", + "experimental": true, + "parameters": [ + { + "name": "styleSheetId", + "$ref": "DOM.StyleSheetId" + }, + { + "name": "range", + "$ref": "SourceRange" + }, + { + "name": "text", + "type": "string" + } + ], + "returns": [ + { + "name": "navigation", + "description": "The resulting CSS Navigation rule after modification.", + "$ref": "CSSNavigation" + } + ] + }, { "name": "setScopeText", "description": "Modifies the expression of a scope at-rule.", @@ -6165,7 +6325,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6190,7 +6350,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "range", @@ -6215,7 +6375,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" }, { "name": "text", @@ -6343,7 +6503,7 @@ "parameters": [ { "name": "styleSheetId", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -6354,7 +6514,7 @@ { "name": "styleSheetId", "description": "Identifier of the removed stylesheet.", - "$ref": "StyleSheetId" + "$ref": "DOM.StyleSheetId" } ] }, @@ -6774,6 +6934,11 @@ "description": "Unique DOM node identifier used to reference a node that may not have been pushed to the\nfront-end.", "type": "integer" }, + { + "id": "StyleSheetId", + "description": "Unique identifier for a CSS stylesheet.", + "type": "string" + }, { "id": "BackendNode", "description": "Backend node with a friendly name.", @@ -6839,8 +7004,7 @@ "details-content", "picker", "permission-icon", - "overscroll-area-parent", - "overscroll-client-area" + "overscroll-area-parent" ] }, { @@ -7102,6 +7266,21 @@ "experimental": true, "optional": true, "type": "boolean" + }, + { + "name": "adoptedStyleSheets", + "experimental": true, + "optional": true, + "type": "array", + "items": { + "$ref": "StyleSheetId" + } + }, + { + "name": "isAdRelated", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -8473,8 +8652,9 @@ ] }, { - "name": "attributeRemoved", - "description": "Fired when `Element`'s attribute is removed.", + "name": "adoptedStyleSheetsModified", + "description": "Fired when `Element`'s adoptedStyleSheets are modified.", + "experimental": true, "parameters": [ { "name": "nodeId", @@ -8482,9 +8662,29 @@ "$ref": "NodeId" }, { - "name": "name", - "description": "A ttribute name.", - "type": "string" + "name": "adoptedStyleSheets", + "description": "New adoptedStyleSheets array.", + "experimental": true, + "type": "array", + "items": { + "$ref": "StyleSheetId" + } + } + ] + }, + { + "name": "attributeRemoved", + "description": "Fired when `Element`'s attribute is removed.", + "parameters": [ + { + "name": "nodeId", + "description": "Id of the node that has changed.", + "$ref": "NodeId" + }, + { + "name": "name", + "description": "A ttribute name.", + "type": "string" } ] }, @@ -8635,6 +8835,23 @@ } ] }, + { + "name": "adRelatedStateUpdated", + "description": "Fired when a node's ad related state changes.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "The id of the node.", + "$ref": "DOM.NodeId" + }, + { + "name": "isAdRelated", + "description": "If the node is ad related.", + "type": "boolean" + } + ] + }, { "name": "affectedByStartingStylesFlagUpdated", "description": "Fired when a node's starting styles changes.", @@ -10636,6 +10853,7 @@ "type": "string", "enum": [ "avif", + "jxl", "webp" ] } @@ -10819,6 +11037,24 @@ "deprecated": true, "optional": true, "$ref": "DevicePosture" + }, + { + "name": "scrollbarType", + "description": "Scrollbar type. Default: `default`.", + "experimental": true, + "optional": true, + "type": "string", + "enum": [ + "overlay", + "default" + ] + }, + { + "name": "screenOrientationLockEmulation", + "description": "If set to true, enables screen orientation lock emulation, which\nintercepts screen.orientation.lock() calls from the page and reports\norientation changes via screenOrientationLockChanged events. This is\nuseful for emulating mobile device orientation lock behavior in\nresponsive design mode.", + "experimental": true, + "optional": true, + "type": "boolean" } ] }, @@ -11351,7 +11587,7 @@ }, { "name": "getScreenInfos", - "description": "Returns device's screen configuration.", + "description": "Returns device's screen configuration. In headful mode, the physical screens configuration is returned,\nwhereas in headless mode, a virtual headless screen configuration is provided instead.", "experimental": true, "returns": [ { @@ -11432,6 +11668,84 @@ } ] }, + { + "name": "updateScreen", + "description": "Updates specified screen parameters. Only supported in headless mode.", + "experimental": true, + "parameters": [ + { + "name": "screenId", + "description": "Target screen identifier.", + "$ref": "ScreenId" + }, + { + "name": "left", + "description": "Offset of the left edge of the screen in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "top", + "description": "Offset of the top edge of the screen in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "width", + "description": "The width of the screen in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "height", + "description": "The height of the screen in pixels.", + "optional": true, + "type": "integer" + }, + { + "name": "workAreaInsets", + "description": "Specifies the screen's work area.", + "optional": true, + "$ref": "WorkAreaInsets" + }, + { + "name": "devicePixelRatio", + "description": "Specifies the screen's device pixel ratio.", + "optional": true, + "type": "number" + }, + { + "name": "rotation", + "description": "Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270.", + "optional": true, + "type": "integer" + }, + { + "name": "colorDepth", + "description": "Specifies the screen's color depth in bits.", + "optional": true, + "type": "integer" + }, + { + "name": "label", + "description": "Specifies the descriptive label for the screen.", + "optional": true, + "type": "string" + }, + { + "name": "isInternal", + "description": "Indicates whether the screen is internal to the device or external, attached to the device. Default is false.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "screenInfo", + "$ref": "ScreenInfo" + } + ] + }, { "name": "removeScreen", "description": "Remove screen from the device. Only supported in headless mode.", @@ -11442,6 +11756,17 @@ "$ref": "ScreenId" } ] + }, + { + "name": "setPrimaryScreen", + "description": "Set primary screen. Only supported in headless mode.\nNote that this changes the coordinate system origin to the top-left\nof the new primary screen, updating the bounds and work areas\nof all existing screens accordingly.", + "experimental": true, + "parameters": [ + { + "name": "screenId", + "$ref": "ScreenId" + } + ] } ], "events": [ @@ -11449,6 +11774,24 @@ "name": "virtualTimeBudgetExpired", "description": "Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.", "experimental": true + }, + { + "name": "screenOrientationLockChanged", + "description": "Fired when a page calls screen.orientation.lock() or screen.orientation.unlock()\nwhile device emulation is enabled. This allows the DevTools frontend to update the\nemulated device orientation accordingly.", + "experimental": true, + "parameters": [ + { + "name": "locked", + "description": "Whether the screen orientation is currently locked.", + "type": "boolean" + }, + { + "name": "orientation", + "description": "The orientation lock type requested by the page. Only set when locked is true.", + "optional": true, + "$ref": "ScreenOrientation" + } + ] } ] }, @@ -11500,9 +11843,57 @@ "sync", "managed" ] + }, + { + "id": "ExtensionInfo", + "description": "Detailed information about an extension.", + "type": "object", + "properties": [ + { + "name": "id", + "description": "Extension id.", + "type": "string" + }, + { + "name": "name", + "description": "Extension name.", + "type": "string" + }, + { + "name": "version", + "description": "Extension version.", + "type": "string" + }, + { + "name": "path", + "description": "The path from which the extension was loaded.", + "type": "string" + }, + { + "name": "enabled", + "description": "Extension enabled status.", + "type": "boolean" + } + ] } ], "commands": [ + { + "name": "triggerAction", + "description": "Runs an extension default action.\nAvailable if the client is connected using the --remote-debugging-pipe\nflag and the --enable-unsafe-extension-debugging flag is set.", + "parameters": [ + { + "name": "id", + "description": "Extension id.", + "type": "string" + }, + { + "name": "targetId", + "description": "A tab target ID to trigger the default extension action on.", + "type": "string" + } + ] + }, { "name": "loadUnpacked", "description": "Installs an unpacked extension from the filesystem similar to\n--load-extension CLI flags. Returns extension ID once the extension\nhas been installed. Available if the client is connected using the\n--remote-debugging-pipe flag and the --enable-unsafe-extension-debugging\nflag is set.", @@ -11511,6 +11902,12 @@ "name": "path", "description": "Absolute file path.", "type": "string" + }, + { + "name": "enableInIncognito", + "description": "Enable the extension in incognito", + "optional": true, + "type": "boolean" } ], "returns": [ @@ -11521,6 +11918,19 @@ } ] }, + { + "name": "getExtensions", + "description": "Gets a list of all unpacked extensions.\nAvailable if the client is connected using the --remote-debugging-pipe flag\nand the --enable-unsafe-extension-debugging flag is set.", + "returns": [ + { + "name": "extensions", + "type": "array", + "items": { + "$ref": "ExtensionInfo" + } + } + ] + }, { "name": "uninstall", "description": "Uninstalls an unpacked extension (others not supported) from the profile.\nAvailable if the client is connected using the --remote-debugging-pipe flag\nand the --enable-unsafe-extension-debugging.", @@ -15185,6 +15595,19 @@ "VeryHigh" ] }, + { + "id": "RenderBlockingBehavior", + "description": "The render-blocking behavior of a resource request.", + "experimental": true, + "type": "string", + "enum": [ + "Blocking", + "InBodyParserBlocking", + "NonBlocking", + "NonBlockingDynamic", + "PotentiallyBlocking" + ] + }, { "id": "PostDataEntry", "description": "Post data entry for HTTP request", @@ -15472,21 +15895,6 @@ "sri-message-signature-mismatch" ] }, - { - "id": "IpProxyStatus", - "description": "Sets Controls for IP Proxy of requests.\nPage reload is required before the new behavior will be observed.", - "experimental": true, - "type": "string", - "enum": [ - "Available", - "FeatureNotEnabled", - "MaskedDomainListNotEnabled", - "MaskedDomainListNotPopulated", - "AuthTokensUnavailable", - "Unavailable", - "BypassedByDevTools" - ] - }, { "id": "CorsError", "description": "The reason why request was blocked.", @@ -15511,21 +15919,14 @@ "PreflightInvalidAllowCredentials", "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", - "PreflightMissingAllowPrivateNetwork", - "PreflightInvalidAllowPrivateNetwork", "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", "RedirectContainsCredentials", - "InsecurePrivateNetwork", - "InvalidPrivateNetworkAccess", - "UnexpectedPrivateNetworkAccess", + "InsecureLocalNetwork", + "InvalidLocalNetworkAccess", "NoCorsRedirectModeNotFollow", - "PreflightMissingPrivateNetworkAccessId", - "PreflightMissingPrivateNetworkAccessName", - "PrivateNetworkAccessPermissionUnavailable", - "PrivateNetworkAccessPermissionDenied", "LocalNetworkAccessPermissionDenied" ] }, @@ -15807,13 +16208,6 @@ "description": "Security details for the request.", "optional": true, "$ref": "SecurityDetails" - }, - { - "name": "isIpProtectionUsed", - "description": "Indicates whether the request was sent through IP Protection proxies. If\nset to true, the request used the IP Protection privacy feature.", - "experimental": true, - "optional": true, - "type": "boolean" } ] }, @@ -16050,13 +16444,6 @@ "experimental": true, "$ref": "CookiePriority" }, - { - "name": "sameParty", - "description": "True if cookie is SameParty.", - "experimental": true, - "deprecated": true, - "type": "boolean" - }, { "name": "sourceScheme", "description": "Cookie source scheme type.", @@ -16108,8 +16495,6 @@ "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", - "SamePartyFromCrossPartyContext", - "SamePartyConflictsWithOtherAttributes", "NameValuePairExceedsMaxSize", "DisallowedCharacter", "NoCookieContent" @@ -16135,7 +16520,6 @@ "SchemefulSameSiteStrict", "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", - "SamePartyFromCrossPartyContext", "NameValuePairExceedsMaxSize", "PortMismatch", "SchemeMismatch", @@ -16302,13 +16686,6 @@ "optional": true, "$ref": "CookiePriority" }, - { - "name": "sameParty", - "description": "True if cookie is SameParty.", - "experimental": true, - "optional": true, - "type": "boolean" - }, { "name": "sourceScheme", "description": "Cookie source scheme type.", @@ -16771,6 +17148,22 @@ "description": "Expected to be unsigned integer.", "optional": true, "type": "number" + }, + { + "name": "multicastLoopback", + "optional": true, + "type": "boolean" + }, + { + "name": "multicastTimeToLive", + "description": "Unsigned int 8.", + "optional": true, + "type": "integer" + }, + { + "name": "multicastAllowAddressSharing", + "optional": true, + "type": "boolean" } ] }, @@ -16798,7 +17191,7 @@ ] }, { - "id": "PrivateNetworkRequestPolicy", + "id": "LocalNetworkAccessRequestPolicy", "experimental": true, "type": "string", "enum": [ @@ -16846,37 +17239,82 @@ "$ref": "IPAddressSpace" }, { - "name": "privateNetworkRequestPolicy", - "$ref": "PrivateNetworkRequestPolicy" + "name": "localNetworkAccessRequestPolicy", + "$ref": "LocalNetworkAccessRequestPolicy" } ] }, { - "id": "CrossOriginOpenerPolicyValue", - "experimental": true, - "type": "string", - "enum": [ - "SameOrigin", - "SameOriginAllowPopups", - "RestrictProperties", - "UnsafeNone", - "SameOriginPlusCoep", - "RestrictPropertiesPlusCoep", - "NoopenerAllowPopups" - ] - }, - { - "id": "CrossOriginOpenerPolicyStatus", + "id": "AdScriptIdentifier", + "description": "Identifies the script on the stack that caused a resource or element to be\nlabeled as an ad. For resources, this indicates the context that triggered\nthe fetch. For elements, this indicates the context that caused the element\nto be appended to the DOM.", "experimental": true, "type": "object", "properties": [ { - "name": "value", - "$ref": "CrossOriginOpenerPolicyValue" + "name": "scriptId", + "description": "The script's V8 identifier.", + "$ref": "Runtime.ScriptId" }, { - "name": "reportOnlyValue", - "$ref": "CrossOriginOpenerPolicyValue" + "name": "debuggerId", + "description": "V8's debugging ID for the v8::Context.", + "$ref": "Runtime.UniqueDebuggerId" + }, + { + "name": "name", + "description": "The script's url (or generated name based on id if inline script).", + "type": "string" + } + ] + }, + { + "id": "AdAncestry", + "description": "Encapsulates the script ancestry and the root script filter list rule that\ncaused the resource or element to be labeled as an ad.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "ancestryChain", + "description": "A chain of `AdScriptIdentifier`s representing the ancestry of an ad\nscript that led to the creation of a resource or element. The chain is\nordered from the script itself (lowest level) up to its root ancestor\nthat was flagged by a filter list.", + "type": "array", + "items": { + "$ref": "AdScriptIdentifier" + } + }, + { + "name": "rootScriptFilterlistRule", + "description": "The filter list rule that caused the root (last) script in\n`ancestryChain` to be tagged as an ad.", + "optional": true, + "type": "string" + } + ] + }, + { + "id": "CrossOriginOpenerPolicyValue", + "experimental": true, + "type": "string", + "enum": [ + "SameOrigin", + "SameOriginAllowPopups", + "RestrictProperties", + "UnsafeNone", + "SameOriginPlusCoep", + "RestrictPropertiesPlusCoep", + "NoopenerAllowPopups" + ] + }, + { + "id": "CrossOriginOpenerPolicyStatus", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "value", + "$ref": "CrossOriginOpenerPolicyValue" + }, + { + "name": "reportOnlyValue", + "$ref": "CrossOriginOpenerPolicyValue" }, { "name": "reportingEndpoint", @@ -17063,194 +17501,586 @@ ] }, { - "id": "LoadNetworkResourcePageResult", - "description": "An object providing the result of a network resource load.", + "id": "DeviceBoundSessionKey", + "description": "Unique identifier for a device bound session.", "experimental": true, "type": "object", "properties": [ { - "name": "success", - "type": "boolean" - }, - { - "name": "netError", - "description": "Optional values used for error reporting.", - "optional": true, - "type": "number" - }, - { - "name": "netErrorName", - "optional": true, + "name": "site", + "description": "The site the session is set up for.", "type": "string" }, { - "name": "httpStatusCode", - "optional": true, - "type": "number" - }, + "name": "id", + "description": "The id of the session.", + "type": "string" + } + ] + }, + { + "id": "DeviceBoundSessionWithUsage", + "description": "How a device bound session was used during a request.", + "experimental": true, + "type": "object", + "properties": [ { - "name": "stream", - "description": "If successful, one of the following two fields holds the result.", - "optional": true, - "$ref": "IO.StreamHandle" + "name": "sessionKey", + "description": "The key for the session.", + "$ref": "DeviceBoundSessionKey" }, { - "name": "headers", - "description": "Response headers.", - "optional": true, - "$ref": "Network.Headers" + "name": "usage", + "description": "How the session was used (or not used).", + "type": "string", + "enum": [ + "NotInScope", + "InScopeRefreshNotYetNeeded", + "InScopeRefreshNotAllowed", + "ProactiveRefreshNotPossible", + "ProactiveRefreshAttempted", + "Deferred" + ] } ] }, { - "id": "LoadNetworkResourceOptions", - "description": "An options object that may be extended later to better support CORS,\nCORB and streaming.", + "id": "DeviceBoundSessionCookieCraving", + "description": "A device bound session's cookie craving.", "experimental": true, "type": "object", "properties": [ { - "name": "disableCache", + "name": "name", + "description": "The name of the craving.", + "type": "string" + }, + { + "name": "domain", + "description": "The domain of the craving.", + "type": "string" + }, + { + "name": "path", + "description": "The path of the craving.", + "type": "string" + }, + { + "name": "secure", + "description": "The `Secure` attribute of the craving attributes.", "type": "boolean" }, { - "name": "includeCredentials", + "name": "httpOnly", + "description": "The `HttpOnly` attribute of the craving attributes.", "type": "boolean" + }, + { + "name": "sameSite", + "description": "The `SameSite` attribute of the craving attributes.", + "optional": true, + "$ref": "CookieSameSite" } ] - } - ], - "commands": [ + }, { - "name": "getIPProtectionProxyStatus", - "description": "Returns enum representing if IP Proxy of requests is available\nor reason it is not active.", + "id": "DeviceBoundSessionUrlRule", + "description": "A device bound session's inclusion URL rule.", "experimental": true, - "returns": [ + "type": "object", + "properties": [ { - "name": "status", - "description": "Whether IP proxy is available", - "$ref": "IpProxyStatus" + "name": "ruleType", + "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`.", + "type": "string", + "enum": [ + "Exclude", + "Include" + ] + }, + { + "name": "hostPattern", + "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`.", + "type": "string" + }, + { + "name": "pathPrefix", + "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`.", + "type": "string" } ] }, { - "name": "setIPProtectionProxyBypassEnabled", - "description": "Sets bypass IP Protection Proxy boolean.", + "id": "DeviceBoundSessionInclusionRules", + "description": "A device bound session's inclusion rules.", "experimental": true, - "parameters": [ + "type": "object", + "properties": [ { - "name": "enabled", - "description": "Whether IP Proxy is being bypassed by devtools; false by default.", + "name": "origin", + "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`.", + "type": "string" + }, + { + "name": "includeSite", + "description": "Whether the whole site is included. See comments on\n`net::device_bound_sessions::SessionInclusionRules::include_site_` for more\ndetails; this boolean is true if that value is populated.", "type": "boolean" + }, + { + "name": "urlRules", + "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`.", + "type": "array", + "items": { + "$ref": "DeviceBoundSessionUrlRule" + } } ] }, { - "name": "setAcceptedEncodings", - "description": "Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.", + "id": "DeviceBoundSession", + "description": "A device bound session.", "experimental": true, - "parameters": [ + "type": "object", + "properties": [ { - "name": "encodings", - "description": "List of accepted content encodings.", + "name": "key", + "description": "The site and session ID of the session.", + "$ref": "DeviceBoundSessionKey" + }, + { + "name": "refreshUrl", + "description": "See comments on `net::device_bound_sessions::Session::refresh_url_`.", + "type": "string" + }, + { + "name": "inclusionRules", + "description": "See comments on `net::device_bound_sessions::Session::inclusion_rules_`.", + "$ref": "DeviceBoundSessionInclusionRules" + }, + { + "name": "cookieCravings", + "description": "See comments on `net::device_bound_sessions::Session::cookie_cravings_`.", "type": "array", "items": { - "$ref": "ContentEncoding" + "$ref": "DeviceBoundSessionCookieCraving" } - } - ] - }, - { - "name": "clearAcceptedEncodingsOverride", - "description": "Clears accepted encodings set by setAcceptedEncodings", - "experimental": true - }, - { - "name": "canClearBrowserCache", - "description": "Tells whether clearing browser cache is supported.", - "deprecated": true, - "returns": [ + }, { - "name": "result", - "description": "True if browser cache can be cleared.", - "type": "boolean" - } - ] - }, - { - "name": "canClearBrowserCookies", - "description": "Tells whether clearing browser cookies is supported.", - "deprecated": true, - "returns": [ + "name": "expiryDate", + "description": "See comments on `net::device_bound_sessions::Session::expiry_date_`.", + "$ref": "Network.TimeSinceEpoch" + }, { - "name": "result", - "description": "True if browser cookies can be cleared.", - "type": "boolean" - } - ] - }, - { - "name": "canEmulateNetworkConditions", - "description": "Tells whether emulation of network conditions is supported.", - "deprecated": true, - "returns": [ + "name": "cachedChallenge", + "description": "See comments on `net::device_bound_sessions::Session::cached_challenge__`.", + "optional": true, + "type": "string" + }, { - "name": "result", - "description": "True if emulation of network conditions is supported.", - "type": "boolean" + "name": "allowedRefreshInitiators", + "description": "See comments on `net::device_bound_sessions::Session::allowed_refresh_initiators_`.", + "type": "array", + "items": { + "type": "string" + } } ] }, { - "name": "clearBrowserCache", - "description": "Clears browser cache." - }, - { - "name": "clearBrowserCookies", - "description": "Clears browser cookies." + "id": "DeviceBoundSessionEventId", + "description": "A unique identifier for a device bound session event.", + "experimental": true, + "type": "string" }, { - "name": "continueInterceptedRequest", - "description": "Response to Network.requestIntercepted which either modifies the request to continue with any\nmodifications, or blocks it, or completes it with the provided response bytes. If a network\nfetch occurs as a result which encounters a redirect an additional Network.requestIntercepted\nevent will be sent with the same InterceptionId.\nDeprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.", + "id": "DeviceBoundSessionFetchResult", + "description": "A fetch result for a device bound session creation or refresh.", "experimental": true, - "deprecated": true, - "parameters": [ - { - "name": "interceptionId", - "$ref": "InterceptionId" - }, + "type": "string", + "enum": [ + "Success", + "KeyError", + "SigningError", + "ServerRequestedTermination", + "InvalidSessionId", + "InvalidChallenge", + "TooManyChallenges", + "InvalidFetcherUrl", + "InvalidRefreshUrl", + "TransientHttpError", + "ScopeOriginSameSiteMismatch", + "RefreshUrlSameSiteMismatch", + "MismatchedSessionId", + "MissingScope", + "NoCredentials", + "SubdomainRegistrationWellKnownUnavailable", + "SubdomainRegistrationUnauthorized", + "SubdomainRegistrationWellKnownMalformed", + "SessionProviderWellKnownUnavailable", + "RelyingPartyWellKnownUnavailable", + "FederatedKeyThumbprintMismatch", + "InvalidFederatedSessionUrl", + "InvalidFederatedKey", + "TooManyRelyingOriginLabels", + "BoundCookieSetForbidden", + "NetError", + "ProxyError", + "EmptySessionConfig", + "InvalidCredentialsConfig", + "InvalidCredentialsType", + "InvalidCredentialsEmptyName", + "InvalidCredentialsCookie", + "PersistentHttpError", + "RegistrationAttemptedChallenge", + "InvalidScopeOrigin", + "ScopeOriginContainsPath", + "RefreshInitiatorNotString", + "RefreshInitiatorInvalidHostPattern", + "InvalidScopeSpecification", + "MissingScopeSpecificationType", + "EmptyScopeSpecificationDomain", + "EmptyScopeSpecificationPath", + "InvalidScopeSpecificationType", + "InvalidScopeIncludeSite", + "MissingScopeIncludeSite", + "FederatedNotAuthorizedByProvider", + "FederatedNotAuthorizedByRelyingParty", + "SessionProviderWellKnownMalformed", + "SessionProviderWellKnownHasProviderOrigin", + "RelyingPartyWellKnownMalformed", + "RelyingPartyWellKnownHasRelyingOrigins", + "InvalidFederatedSessionProviderSessionMissing", + "InvalidFederatedSessionWrongProviderOrigin", + "InvalidCredentialsCookieCreationTime", + "InvalidCredentialsCookieName", + "InvalidCredentialsCookieParsing", + "InvalidCredentialsCookieUnpermittedAttribute", + "InvalidCredentialsCookieInvalidDomain", + "InvalidCredentialsCookiePrefix", + "InvalidScopeRulePath", + "InvalidScopeRuleHostPattern", + "ScopeRuleOriginScopedHostPatternMismatch", + "ScopeRuleSiteScopedHostPatternMismatch", + "SigningQuotaExceeded", + "InvalidConfigJson", + "InvalidFederatedSessionProviderFailedToRestoreKey", + "FailedToUnwrapKey", + "SessionDeletedDuringRefresh" + ] + }, + { + "id": "DeviceBoundSessionFailedRequest", + "description": "Details about a failed device bound session network request.", + "experimental": true, + "type": "object", + "properties": [ { - "name": "errorReason", - "description": "If set this causes the request to fail with the given reason. Passing `Aborted` for requests\nmarked with `isNavigationRequest` also cancels the navigation. Must not be set in response\nto an authChallenge.", - "optional": true, - "$ref": "ErrorReason" + "name": "requestUrl", + "description": "The failed request URL.", + "type": "string" }, { - "name": "rawResponse", - "description": "If set the requests completes using with the provided base64 encoded raw response, including\nHTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)", + "name": "netError", + "description": "The net error of the response if it was not OK.", "optional": true, "type": "string" }, { - "name": "url", - "description": "If set the request url will be modified in a way that's not observable by page. Must not be\nset in response to an authChallenge.", + "name": "responseError", + "description": "The response code if the net error was OK and the response code was not\n200.", "optional": true, - "type": "string" + "type": "integer" }, { - "name": "method", - "description": "If set this allows the request method to be overridden. Must not be set in response to an\nauthChallenge.", + "name": "responseErrorBody", + "description": "The body of the response if the net error was OK, the response code was\nnot 200, and the response body was not empty.", "optional": true, "type": "string" + } + ] + }, + { + "id": "CreationEventDetails", + "description": "Session event details specific to creation.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "fetchResult", + "description": "The result of the fetch attempt.", + "$ref": "DeviceBoundSessionFetchResult" }, { - "name": "postData", - "description": "If set this allows postData to be set. Must not be set in response to an authChallenge.", + "name": "newSession", + "description": "The session if there was a newly created session. This is populated for\nall successful creation events.", "optional": true, - "type": "string" + "$ref": "DeviceBoundSession" }, { - "name": "headers", - "description": "If set this allows the request headers to be changed. Must not be set in response to an\nauthChallenge.", + "name": "failedRequest", + "description": "Details about a failed device bound session network request if there was\none.", + "optional": true, + "$ref": "DeviceBoundSessionFailedRequest" + } + ] + }, + { + "id": "RefreshEventDetails", + "description": "Session event details specific to refresh.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "refreshResult", + "description": "The result of a refresh.", + "type": "string", + "enum": [ + "Refreshed", + "InitializedService", + "Unreachable", + "ServerError", + "RefreshQuotaExceeded", + "FatalError", + "SigningQuotaExceeded" + ] + }, + { + "name": "fetchResult", + "description": "If there was a fetch attempt, the result of that.", + "optional": true, + "$ref": "DeviceBoundSessionFetchResult" + }, + { + "name": "newSession", + "description": "The session display if there was a newly created session. This is populated\nfor any refresh event that modifies the session config.", + "optional": true, + "$ref": "DeviceBoundSession" + }, + { + "name": "wasFullyProactiveRefresh", + "description": "See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.", + "type": "boolean" + }, + { + "name": "failedRequest", + "description": "Details about a failed device bound session network request if there was\none.", + "optional": true, + "$ref": "DeviceBoundSessionFailedRequest" + } + ] + }, + { + "id": "TerminationEventDetails", + "description": "Session event details specific to termination.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "deletionReason", + "description": "The reason for a session being deleted.", + "type": "string", + "enum": [ + "Expired", + "FailedToRestoreKey", + "FailedToUnwrapKey", + "StoragePartitionCleared", + "ClearBrowsingData", + "ServerRequested", + "InvalidSessionParams", + "RefreshFatalError" + ] + } + ] + }, + { + "id": "ChallengeEventDetails", + "description": "Session event details specific to challenges.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "challengeResult", + "description": "The result of a challenge.", + "type": "string", + "enum": [ + "Success", + "NoSessionId", + "NoSessionMatch", + "CantSetBoundCookie" + ] + }, + { + "name": "challenge", + "description": "The challenge set.", + "type": "string" + } + ] + }, + { + "id": "LoadNetworkResourcePageResult", + "description": "An object providing the result of a network resource load.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "success", + "type": "boolean" + }, + { + "name": "netError", + "description": "Optional values used for error reporting.", + "optional": true, + "type": "number" + }, + { + "name": "netErrorName", + "optional": true, + "type": "string" + }, + { + "name": "httpStatusCode", + "optional": true, + "type": "number" + }, + { + "name": "stream", + "description": "If successful, one of the following two fields holds the result.", + "optional": true, + "$ref": "IO.StreamHandle" + }, + { + "name": "headers", + "description": "Response headers.", + "optional": true, + "$ref": "Network.Headers" + } + ] + }, + { + "id": "LoadNetworkResourceOptions", + "description": "An options object that may be extended later to better support CORS,\nCORB and streaming.", + "experimental": true, + "type": "object", + "properties": [ + { + "name": "disableCache", + "type": "boolean" + }, + { + "name": "includeCredentials", + "type": "boolean" + } + ] + } + ], + "commands": [ + { + "name": "setAcceptedEncodings", + "description": "Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.", + "experimental": true, + "parameters": [ + { + "name": "encodings", + "description": "List of accepted content encodings.", + "type": "array", + "items": { + "$ref": "ContentEncoding" + } + } + ] + }, + { + "name": "clearAcceptedEncodingsOverride", + "description": "Clears accepted encodings set by setAcceptedEncodings", + "experimental": true + }, + { + "name": "canClearBrowserCache", + "description": "Tells whether clearing browser cache is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if browser cache can be cleared.", + "type": "boolean" + } + ] + }, + { + "name": "canClearBrowserCookies", + "description": "Tells whether clearing browser cookies is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if browser cookies can be cleared.", + "type": "boolean" + } + ] + }, + { + "name": "canEmulateNetworkConditions", + "description": "Tells whether emulation of network conditions is supported.", + "deprecated": true, + "returns": [ + { + "name": "result", + "description": "True if emulation of network conditions is supported.", + "type": "boolean" + } + ] + }, + { + "name": "clearBrowserCache", + "description": "Clears browser cache." + }, + { + "name": "clearBrowserCookies", + "description": "Clears browser cookies." + }, + { + "name": "continueInterceptedRequest", + "description": "Response to Network.requestIntercepted which either modifies the request to continue with any\nmodifications, or blocks it, or completes it with the provided response bytes. If a network\nfetch occurs as a result which encounters a redirect an additional Network.requestIntercepted\nevent will be sent with the same InterceptionId.\nDeprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.", + "experimental": true, + "deprecated": true, + "parameters": [ + { + "name": "interceptionId", + "$ref": "InterceptionId" + }, + { + "name": "errorReason", + "description": "If set this causes the request to fail with the given reason. Passing `Aborted` for requests\nmarked with `isNavigationRequest` also cancels the navigation. Must not be set in response\nto an authChallenge.", + "optional": true, + "$ref": "ErrorReason" + }, + { + "name": "rawResponse", + "description": "If set the requests completes using with the provided base64 encoded raw response, including\nHTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)", + "optional": true, + "type": "string" + }, + { + "name": "url", + "description": "If set the request url will be modified in a way that's not observable by page. Must not be\nset in response to an authChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "method", + "description": "If set this allows the request method to be overridden. Must not be set in response to an\nauthChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "postData", + "description": "If set this allows postData to be set. Must not be set in response to an authChallenge.", + "optional": true, + "type": "string" + }, + { + "name": "headers", + "description": "If set this allows the request headers to be changed. Must not be set in response to an\nauthChallenge.", "optional": true, "$ref": "Headers" }, @@ -17425,7 +18255,7 @@ "parameters": [ { "name": "maxTotalBufferSize", - "description": "Buffer size in bytes to use when preserving network payloads (XHRs, etc).", + "description": "Buffer size in bytes to use when preserving network payloads (XHRs, etc).\nThis is the maximum number of bytes that will be collected by this\nDevTools session.", "experimental": true, "optional": true, "type": "integer" @@ -17452,13 +18282,32 @@ }, { "name": "enableDurableMessages", - "description": "Enable storing response bodies outside of renderer, so that these survive\na cross-process navigation. Requires maxTotalBufferSize to be set.\nCurrently defaults to false.", + "description": "Enable storing response bodies outside of renderer, so that these survive\na cross-process navigation. Requires maxTotalBufferSize to be set.\nCurrently defaults to false. This field is being deprecated in favor of the dedicated\nconfigureDurableMessages command, due to the possibility of deadlocks when awaiting\nNetwork.enable before issuing Runtime.runIfWaitingForDebugger.", "experimental": true, "optional": true, "type": "boolean" } ] }, + { + "name": "configureDurableMessages", + "description": "Configures storing response bodies outside of renderer, so that these survive\na cross-process navigation.\nIf maxTotalBufferSize is not set, durable messages are disabled.", + "experimental": true, + "parameters": [ + { + "name": "maxTotalBufferSize", + "description": "Buffer size in bytes to use when preserving network payloads (XHRs, etc).", + "optional": true, + "type": "integer" + }, + { + "name": "maxResourceBufferSize", + "description": "Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).", + "optional": true, + "type": "integer" + } + ] + }, { "name": "getAllCookies", "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie\ninformation in the `cookies` field.\nDeprecated. Use Storage.getCookies instead.", @@ -17558,6 +18407,11 @@ "name": "postData", "description": "Request body string, omitting files from multipart requests", "type": "string" + }, + { + "name": "base64Encoded", + "description": "True, if content was sent as base64.", + "type": "boolean" } ] }, @@ -17764,13 +18618,6 @@ "optional": true, "$ref": "CookiePriority" }, - { - "name": "sameParty", - "description": "True if cookie is SameParty.", - "experimental": true, - "optional": true, - "type": "boolean" - }, { "name": "sourceScheme", "description": "Cookie source scheme type.", @@ -17937,20 +18784,51 @@ ] }, { - "name": "loadNetworkResource", - "description": "Fetches the resource and returns the content.", + "name": "enableDeviceBoundSessions", + "description": "Sets up tracking device bound sessions and fetching of initial set of sessions.", "experimental": true, "parameters": [ { - "name": "frameId", - "description": "Frame id to get the resource for. Mandatory for frame targets, and\nshould be omitted for worker targets.", - "optional": true, - "$ref": "Page.FrameId" - }, - { - "name": "url", - "description": "URL of the resource to get content for.", - "type": "string" + "name": "enable", + "description": "Whether to enable or disable events.", + "type": "boolean" + } + ] + }, + { + "name": "fetchSchemefulSite", + "description": "Fetches the schemeful site for a specific origin.", + "experimental": true, + "parameters": [ + { + "name": "origin", + "description": "The URL origin.", + "type": "string" + } + ], + "returns": [ + { + "name": "schemefulSite", + "description": "The corresponding schemeful site.", + "type": "string" + } + ] + }, + { + "name": "loadNetworkResource", + "description": "Fetches the resource and returns the content.", + "experimental": true, + "parameters": [ + { + "name": "frameId", + "description": "Frame id to get the resource for. Mandatory for frame targets, and\nshould be omitted for worker targets.", + "optional": true, + "$ref": "Page.FrameId" + }, + { + "name": "url", + "description": "URL of the resource to get content for.", + "type": "string" }, { "name": "options", @@ -18271,6 +19149,13 @@ "description": "Whether the request is initiated by a user gesture. Defaults to false.", "optional": true, "type": "boolean" + }, + { + "name": "renderBlockingBehavior", + "description": "The render-blocking behavior of the request.", + "experimental": true, + "optional": true, + "$ref": "RenderBlockingBehavior" } ] }, @@ -18703,6 +19588,34 @@ } ] }, + { + "name": "directUDPSocketJoinedMulticastGroup", + "experimental": true, + "parameters": [ + { + "name": "identifier", + "$ref": "RequestId" + }, + { + "name": "IPAddress", + "type": "string" + } + ] + }, + { + "name": "directUDPSocketLeftMulticastGroup", + "experimental": true, + "parameters": [ + { + "name": "identifier", + "$ref": "RequestId" + }, + { + "name": "IPAddress", + "type": "string" + } + ] + }, { "name": "directUDPSocketCreated", "description": "Fired upon direct_socket.UDPSocket creation.", @@ -18863,6 +19776,15 @@ "experimental": true, "$ref": "ConnectTiming" }, + { + "name": "deviceBoundSessionUsages", + "description": "How the request site's device bound sessions were used during this request.", + "optional": true, + "type": "array", + "items": { + "$ref": "DeviceBoundSessionWithUsage" + } + }, { "name": "clientSecurityState", "description": "The client security state set for the request.", @@ -19059,6 +19981,70 @@ } } ] + }, + { + "name": "deviceBoundSessionsAdded", + "description": "Triggered when the initial set of device bound sessions is added.", + "experimental": true, + "parameters": [ + { + "name": "sessions", + "description": "The device bound sessions.", + "type": "array", + "items": { + "$ref": "DeviceBoundSession" + } + } + ] + }, + { + "name": "deviceBoundSessionEventOccurred", + "description": "Triggered when a device bound session event occurs.", + "experimental": true, + "parameters": [ + { + "name": "eventId", + "description": "A unique identifier for this session event.", + "$ref": "DeviceBoundSessionEventId" + }, + { + "name": "site", + "description": "The site this session event is associated with.", + "type": "string" + }, + { + "name": "succeeded", + "description": "Whether this event was considered successful.", + "type": "boolean" + }, + { + "name": "sessionId", + "description": "The session ID this event is associated with. May not be populated for\nfailed events.", + "optional": true, + "type": "string" + }, + { + "name": "creationEventDetails", + "description": "The below are the different session event type details. Exactly one is populated.", + "optional": true, + "$ref": "CreationEventDetails" + }, + { + "name": "refreshEventDetails", + "optional": true, + "$ref": "RefreshEventDetails" + }, + { + "name": "terminationEventDetails", + "optional": true, + "$ref": "TerminationEventDetails" + }, + { + "name": "challengeEventDetails", + "optional": true, + "$ref": "ChallengeEventDetails" + } + ] } ] }, @@ -19688,6 +20674,24 @@ "captureAreaScreenshot", "none" ] + }, + { + "id": "InspectedElementAnchorConfig", + "type": "object", + "properties": [ + { + "name": "nodeId", + "description": "Identifier of the node to highlight.", + "optional": true, + "$ref": "DOM.NodeId" + }, + { + "name": "backendNodeId", + "description": "Identifier of the backend node to highlight.", + "optional": true, + "$ref": "DOM.BackendNodeId" + } + ] } ], "commands": [ @@ -20047,6 +21051,16 @@ } ] }, + { + "name": "setShowInspectedElementAnchor", + "parameters": [ + { + "name": "inspectedElementAnchorConfig", + "description": "Node identifier for which to show an anchor for.", + "$ref": "InspectedElementAnchorConfig" + } + ] + }, { "name": "setShowPaintRects", "description": "Requests that backend shows paint rectangles", @@ -20186,6 +21200,28 @@ } ] }, + { + "name": "inspectPanelShowRequested", + "description": "Fired when user asks to show the Inspect panel.", + "parameters": [ + { + "name": "backendNodeId", + "description": "Id of the node to show in the panel.", + "$ref": "DOM.BackendNodeId" + } + ] + }, + { + "name": "inspectedElementWindowRestored", + "description": "Fired when user asks to restore the Inspected Element floating window.", + "parameters": [ + { + "name": "backendNodeId", + "description": "Id of the node to restore the floating window for.", + "$ref": "DOM.BackendNodeId" + } + ] + }, { "name": "inspectModeCanceled", "description": "Fired when user cancels the inspect mode." @@ -20437,46 +21473,6 @@ } ] }, - { - "id": "AdScriptId", - "description": "Identifies the script which caused a script or frame to be labelled as an\nad.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "scriptId", - "description": "Script Id of the script which caused a script or frame to be labelled as\nan ad.", - "$ref": "Runtime.ScriptId" - }, - { - "name": "debuggerId", - "description": "Id of scriptId's debugger.", - "$ref": "Runtime.UniqueDebuggerId" - } - ] - }, - { - "id": "AdScriptAncestry", - "description": "Encapsulates the script ancestry and the root script filterlist rule that\ncaused the frame to be labelled as an ad. Only created when `ancestryChain`\nis not empty.", - "experimental": true, - "type": "object", - "properties": [ - { - "name": "ancestryChain", - "description": "A chain of `AdScriptId`s representing the ancestry of an ad script that\nled to the creation of a frame. The chain is ordered from the script\nitself (lower level) up to its root ancestor that was flagged by\nfilterlist.", - "type": "array", - "items": { - "$ref": "AdScriptId" - } - }, - { - "name": "rootScriptFilterlistRule", - "description": "The filterlist rule that caused the root (last) script in\n`ancestryChain` to be ad-tagged. Only populated if the rule is\navailable.", - "optional": true, - "type": "string" - } - ] - }, { "id": "SecureContextType", "description": "Indicates whether the frame is a secure context and why it is the case.", @@ -20522,6 +21518,7 @@ "ambient-light-sensor", "aria-notify", "attribution-reporting", + "autofill", "autoplay", "bluetooth", "browsing-topics", @@ -20585,8 +21582,11 @@ "language-detector", "language-model", "local-fonts", + "local-network", "local-network-access", + "loopback-network", "magnetometer", + "manual-text", "media-playback-while-not-visible", "microphone", "midi", @@ -20594,7 +21594,6 @@ "otp-credentials", "payment", "picture-in-picture", - "popins", "private-aggregation", "private-state-token-issuance", "private-state-token-redemption", @@ -20605,7 +21604,6 @@ "run-ad-auction", "screen-wake-lock", "serial", - "shared-autofill", "shared-storage", "shared-storage-select-url", "smart-card", @@ -21872,6 +22870,7 @@ "BackForwardCacheDisabledForPrerender", "UserAgentOverrideDiffers", "ForegroundCacheLimit", + "ForwardCacheDisabled", "BrowsingInstanceNotSwapped", "BackForwardCacheDisabledForDelegate", "UnloadHandlerExistsInMainFrame", @@ -21915,6 +22914,7 @@ "SharedWorkerMessage", "SharedWorkerWithNoActiveClient", "WebLocks", + "WebLocksContention", "WebHID", "WebBluetooth", "WebShare", @@ -22410,7 +23410,7 @@ "name": "adScriptAncestry", "description": "The ancestry chain of ad script identifiers leading to this frame's\ncreation, along with the root script's filterlist rule. The ancestry\nchain is ordered from the most immediate script (in the frame creation\nstack) to more distant ancestors (that created the immediately preceding\nscript). Only sent if frame is labelled as an ad and ids are available.", "optional": true, - "$ref": "AdScriptAncestry" + "$ref": "Network.AdAncestry" } ] }, @@ -23342,6 +24342,26 @@ "type": "boolean" } ] + }, + { + "name": "getAnnotatedPageContent", + "description": "Get the annotated page content for the main frame.\nThis is an experimental command that is subject to change.", + "experimental": true, + "parameters": [ + { + "name": "includeActionableInformation", + "description": "Whether to include actionable information. Defaults to true.", + "optional": true, + "type": "boolean" + } + ], + "returns": [ + { + "name": "content", + "description": "The annotated page content as a base64 encoded protobuf.\nThe format is defined by the `AnnotatedPageContent` message in\ncomponents/optimization_guide/proto/features/common_quality_data.proto (Encoded as a base64 string when passed over JSON)", + "type": "string" + } + ] } ], "events": [ @@ -25155,171 +26175,806 @@ "type": "string" }, { - "name": "sourceURL", + "name": "sourceURL", + "type": "string" + }, + { + "name": "lineNumber", + "type": "integer" + }, + { + "name": "columnNumber", + "type": "integer" + } + ] + } + ], + "commands": [ + { + "name": "deliverPushMessage", + "parameters": [ + { + "name": "origin", + "type": "string" + }, + { + "name": "registrationId", + "$ref": "RegistrationID" + }, + { + "name": "data", + "type": "string" + } + ] + }, + { + "name": "disable" + }, + { + "name": "dispatchSyncEvent", + "parameters": [ + { + "name": "origin", + "type": "string" + }, + { + "name": "registrationId", + "$ref": "RegistrationID" + }, + { + "name": "tag", + "type": "string" + }, + { + "name": "lastChance", + "type": "boolean" + } + ] + }, + { + "name": "dispatchPeriodicSyncEvent", + "parameters": [ + { + "name": "origin", + "type": "string" + }, + { + "name": "registrationId", + "$ref": "RegistrationID" + }, + { + "name": "tag", + "type": "string" + } + ] + }, + { + "name": "enable" + }, + { + "name": "setForceUpdateOnPageLoad", + "parameters": [ + { + "name": "forceUpdateOnPageLoad", + "type": "boolean" + } + ] + }, + { + "name": "skipWaiting", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "startWorker", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "stopAllWorkers" + }, + { + "name": "stopWorker", + "parameters": [ + { + "name": "versionId", + "type": "string" + } + ] + }, + { + "name": "unregister", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + }, + { + "name": "updateRegistration", + "parameters": [ + { + "name": "scopeURL", + "type": "string" + } + ] + } + ], + "events": [ + { + "name": "workerErrorReported", + "parameters": [ + { + "name": "errorMessage", + "$ref": "ServiceWorkerErrorMessage" + } + ] + }, + { + "name": "workerRegistrationUpdated", + "parameters": [ + { + "name": "registrations", + "type": "array", + "items": { + "$ref": "ServiceWorkerRegistration" + } + } + ] + }, + { + "name": "workerVersionUpdated", + "parameters": [ + { + "name": "versions", + "type": "array", + "items": { + "$ref": "ServiceWorkerVersion" + } + } + ] + } + ] + }, + { + "domain": "SmartCardEmulation", + "experimental": true, + "types": [ + { + "id": "ResultCode", + "description": "Indicates the PC/SC error code.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values", + "type": "string", + "enum": [ + "success", + "removed-card", + "reset-card", + "unpowered-card", + "unresponsive-card", + "unsupported-card", + "reader-unavailable", + "sharing-violation", + "not-transacted", + "no-smartcard", + "proto-mismatch", + "system-cancelled", + "not-ready", + "cancelled", + "insufficient-buffer", + "invalid-handle", + "invalid-parameter", + "invalid-value", + "no-memory", + "timeout", + "unknown-reader", + "unsupported-feature", + "no-readers-available", + "service-stopped", + "no-service", + "comm-error", + "internal-error", + "server-too-busy", + "unexpected", + "shutdown", + "unknown-card", + "unknown" + ] + }, + { + "id": "ShareMode", + "description": "Maps to the |SCARD_SHARE_*| values.", + "type": "string", + "enum": [ + "shared", + "exclusive", + "direct" + ] + }, + { + "id": "Disposition", + "description": "Indicates what the reader should do with the card.", + "type": "string", + "enum": [ + "leave-card", + "reset-card", + "unpower-card", + "eject-card" + ] + }, + { + "id": "ConnectionState", + "description": "Maps to |SCARD_*| connection state values.", + "type": "string", + "enum": [ + "absent", + "present", + "swallowed", + "powered", + "negotiable", + "specific" + ] + }, + { + "id": "ReaderStateFlags", + "description": "Maps to the |SCARD_STATE_*| flags.", + "type": "object", + "properties": [ + { + "name": "unaware", + "optional": true, + "type": "boolean" + }, + { + "name": "ignore", + "optional": true, + "type": "boolean" + }, + { + "name": "changed", + "optional": true, + "type": "boolean" + }, + { + "name": "unknown", + "optional": true, + "type": "boolean" + }, + { + "name": "unavailable", + "optional": true, + "type": "boolean" + }, + { + "name": "empty", + "optional": true, + "type": "boolean" + }, + { + "name": "present", + "optional": true, + "type": "boolean" + }, + { + "name": "exclusive", + "optional": true, + "type": "boolean" + }, + { + "name": "inuse", + "optional": true, + "type": "boolean" + }, + { + "name": "mute", + "optional": true, + "type": "boolean" + }, + { + "name": "unpowered", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "ProtocolSet", + "description": "Maps to the |SCARD_PROTOCOL_*| flags.", + "type": "object", + "properties": [ + { + "name": "t0", + "optional": true, + "type": "boolean" + }, + { + "name": "t1", + "optional": true, + "type": "boolean" + }, + { + "name": "raw", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "Protocol", + "description": "Maps to the |SCARD_PROTOCOL_*| values.", + "type": "string", + "enum": [ + "t0", + "t1", + "raw" + ] + }, + { + "id": "ReaderStateIn", + "type": "object", + "properties": [ + { + "name": "reader", + "type": "string" + }, + { + "name": "currentState", + "$ref": "ReaderStateFlags" + }, + { + "name": "currentInsertionCount", + "type": "integer" + } + ] + }, + { + "id": "ReaderStateOut", + "type": "object", + "properties": [ + { + "name": "reader", + "type": "string" + }, + { + "name": "eventState", + "$ref": "ReaderStateFlags" + }, + { + "name": "eventCount", + "type": "integer" + }, + { + "name": "atr", + "type": "string" + } + ] + } + ], + "commands": [ + { + "name": "enable", + "description": "Enables the |SmartCardEmulation| domain." + }, + { + "name": "disable", + "description": "Disables the |SmartCardEmulation| domain." + }, + { + "name": "reportEstablishContextResult", + "description": "Reports the successful result of a |SCardEstablishContext| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + } + ] + }, + { + "name": "reportReleaseContextResult", + "description": "Reports the successful result of a |SCardReleaseContext| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext", + "parameters": [ + { + "name": "requestId", + "type": "string" + } + ] + }, + { + "name": "reportListReadersResult", + "description": "Reports the successful result of a |SCardListReaders| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "readers", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "reportGetStatusChangeResult", + "description": "Reports the successful result of a |SCardGetStatusChange| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "readerStates", + "type": "array", + "items": { + "$ref": "ReaderStateOut" + } + } + ] + }, + { + "name": "reportBeginTransactionResult", + "description": "Reports the result of a |SCardBeginTransaction| call.\nOn success, this creates a new transaction object.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "handle", + "type": "integer" + } + ] + }, + { + "name": "reportPlainResult", + "description": "Reports the successful result of a call that returns only a result code.\nUsed for: |SCardCancel|, |SCardDisconnect|, |SCardSetAttrib|, |SCardEndTransaction|.\n\nThis maps to:\n1. SCardCancel\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel\n\n2. SCardDisconnect\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect\n\n3. SCardSetAttrib\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib\n\n4. SCardEndTransaction\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction", + "parameters": [ + { + "name": "requestId", + "type": "string" + } + ] + }, + { + "name": "reportConnectResult", + "description": "Reports the successful result of a |SCardConnect| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "handle", + "type": "integer" + }, + { + "name": "activeProtocol", + "optional": true, + "$ref": "Protocol" + } + ] + }, + { + "name": "reportDataResult", + "description": "Reports the successful result of a call that sends back data on success.\nUsed for |SCardTransmit|, |SCardControl|, and |SCardGetAttrib|.\n\nThis maps to:\n1. SCardTransmit\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit\n\n2. SCardControl\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol\n\n3. SCardGetAttrib\n PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602\n Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "data", + "type": "string" + } + ] + }, + { + "name": "reportStatusResult", + "description": "Reports the successful result of a |SCardStatus| call.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "readerName", + "type": "string" + }, + { + "name": "state", + "$ref": "ConnectionState" + }, + { + "name": "atr", + "type": "string" + }, + { + "name": "protocol", + "optional": true, + "$ref": "Protocol" + } + ] + }, + { + "name": "reportError", + "description": "Reports an error result for the given request.", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "resultCode", + "$ref": "ResultCode" + } + ] + } + ], + "events": [ + { + "name": "establishContextRequested", + "description": "Fired when |SCardEstablishContext| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext", + "parameters": [ + { + "name": "requestId", + "type": "string" + } + ] + }, + { + "name": "releaseContextRequested", + "description": "Fired when |SCardReleaseContext| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + } + ] + }, + { + "name": "listReadersRequested", + "description": "Fired when |SCardListReaders| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + } + ] + }, + { + "name": "getStatusChangeRequested", + "description": "Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + }, + { + "name": "readerStates", + "type": "array", + "items": { + "$ref": "ReaderStateIn" + } + }, + { + "name": "timeout", + "description": "in milliseconds, if absent, it means \"infinite\"", + "optional": true, + "type": "integer" + } + ] + }, + { + "name": "cancelRequested", + "description": "Fired when |SCardCancel| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + } + ] + }, + { + "name": "connectRequested", + "description": "Fired when |SCardConnect| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta", + "parameters": [ + { + "name": "requestId", + "type": "string" + }, + { + "name": "contextId", + "type": "integer" + }, + { + "name": "reader", "type": "string" }, { - "name": "lineNumber", - "type": "integer" + "name": "shareMode", + "$ref": "ShareMode" }, { - "name": "columnNumber", - "type": "integer" + "name": "preferredProtocols", + "$ref": "ProtocolSet" } ] - } - ], - "commands": [ + }, { - "name": "deliverPushMessage", + "name": "disconnectRequested", + "description": "Fired when |SCardDisconnect| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect", "parameters": [ { - "name": "origin", + "name": "requestId", "type": "string" }, { - "name": "registrationId", - "$ref": "RegistrationID" + "name": "handle", + "type": "integer" }, { - "name": "data", - "type": "string" + "name": "disposition", + "$ref": "Disposition" } ] }, { - "name": "disable" - }, - { - "name": "dispatchSyncEvent", + "name": "transmitRequested", + "description": "Fired when |SCardTransmit| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit", "parameters": [ { - "name": "origin", + "name": "requestId", "type": "string" }, { - "name": "registrationId", - "$ref": "RegistrationID" + "name": "handle", + "type": "integer" }, { - "name": "tag", + "name": "data", "type": "string" }, { - "name": "lastChance", - "type": "boolean" + "name": "protocol", + "optional": true, + "$ref": "Protocol" } ] }, { - "name": "dispatchPeriodicSyncEvent", + "name": "controlRequested", + "description": "Fired when |SCardControl| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol", "parameters": [ { - "name": "origin", + "name": "requestId", "type": "string" }, { - "name": "registrationId", - "$ref": "RegistrationID" + "name": "handle", + "type": "integer" }, { - "name": "tag", - "type": "string" - } - ] - }, - { - "name": "enable" - }, - { - "name": "setForceUpdateOnPageLoad", - "parameters": [ + "name": "controlCode", + "type": "integer" + }, { - "name": "forceUpdateOnPageLoad", - "type": "boolean" + "name": "data", + "type": "string" } ] }, { - "name": "skipWaiting", + "name": "getAttribRequested", + "description": "Fired when |SCardGetAttrib| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib", "parameters": [ { - "name": "scopeURL", + "name": "requestId", "type": "string" + }, + { + "name": "handle", + "type": "integer" + }, + { + "name": "attribId", + "type": "integer" } ] }, { - "name": "startWorker", + "name": "setAttribRequested", + "description": "Fired when |SCardSetAttrib| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib", "parameters": [ { - "name": "scopeURL", + "name": "requestId", "type": "string" - } - ] - }, - { - "name": "stopAllWorkers" - }, - { - "name": "stopWorker", - "parameters": [ + }, { - "name": "versionId", + "name": "handle", + "type": "integer" + }, + { + "name": "attribId", + "type": "integer" + }, + { + "name": "data", "type": "string" } ] }, { - "name": "unregister", + "name": "statusRequested", + "description": "Fired when |SCardStatus| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa", "parameters": [ { - "name": "scopeURL", + "name": "requestId", "type": "string" + }, + { + "name": "handle", + "type": "integer" } ] }, { - "name": "updateRegistration", + "name": "beginTransactionRequested", + "description": "Fired when |SCardBeginTransaction| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction", "parameters": [ { - "name": "scopeURL", + "name": "requestId", "type": "string" - } - ] - } - ], - "events": [ - { - "name": "workerErrorReported", - "parameters": [ + }, { - "name": "errorMessage", - "$ref": "ServiceWorkerErrorMessage" + "name": "handle", + "type": "integer" } ] }, { - "name": "workerRegistrationUpdated", + "name": "endTransactionRequested", + "description": "Fired when |SCardEndTransaction| is called.\n\nThis maps to:\nPC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b\nMicrosoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction", "parameters": [ { - "name": "registrations", - "type": "array", - "items": { - "$ref": "ServiceWorkerRegistration" - } - } - ] - }, - { - "name": "workerVersionUpdated", - "parameters": [ + "name": "requestId", + "type": "string" + }, { - "name": "versions", - "type": "array", - "items": { - "$ref": "ServiceWorkerVersion" - } + "name": "handle", + "type": "integer" + }, + { + "name": "disposition", + "$ref": "Disposition" } ] } @@ -27936,6 +29591,13 @@ "items": { "$ref": "Browser.BrowserContextID" } + }, + { + "name": "defaultBrowserContextId", + "description": "The id of the default browser context if available.", + "experimental": true, + "optional": true, + "$ref": "Browser.BrowserContextID" } ] }, @@ -28019,6 +29681,13 @@ "experimental": true, "optional": true, "type": "boolean" + }, + { + "name": "focus", + "description": "If specified, the option is used to determine if the new target should\nbe focused or not. By default, the focus behavior depends on the\nvalue of the background field. For example, background=false and focus=false\nwill result in the target tab being opened but the browser window remain\nunchanged (if it was in the background, it will remain in the background)\nand background=false with focus=undefined will result in the window being focused.\nUsing background: true and focus: true is not supported and will result in an error.", + "experimental": true, + "optional": true, + "type": "boolean" } ], "returns": [ @@ -28209,6 +29878,26 @@ } ] }, + { + "name": "getDevToolsTarget", + "description": "Gets the targetId of the DevTools page target opened for the given target\n(if any).", + "experimental": true, + "parameters": [ + { + "name": "targetId", + "description": "Page or tab target ID.", + "$ref": "TargetID" + } + ], + "returns": [ + { + "name": "targetId", + "description": "The targetId of DevTools page target if exists.", + "optional": true, + "$ref": "TargetID" + } + ] + }, { "name": "openDevTools", "description": "Opens a DevTools window for the target.", @@ -28221,7 +29910,7 @@ }, { "name": "panelId", - "description": "The id of the panel we want DevTools to open initially. Currently\nsupported panels are elements, console, network, sources and resources.", + "description": "The id of the panel we want DevTools to open initially. Currently\nsupported panels are elements, console, network, sources, resources\nand performance.", "optional": true, "type": "string" } @@ -28553,6 +30242,18 @@ } ] }, + { + "name": "getTrackEventDescriptor", + "description": "Return a descriptor for all available tracing categories.", + "experimental": true, + "returns": [ + { + "name": "descriptor", + "description": "Base64-encoded serialized perfetto.protos.TrackEventDescriptor protobuf message. (Encoded as a base64 string when passed over JSON)", + "type": "string" + } + ] + }, { "name": "recordClockSyncMarker", "description": "Record a clock sync marker in the trace.", @@ -29645,6 +31346,118 @@ ] } ] + }, + { + "domain": "WebMCP", + "experimental": true, + "dependencies": [ + "Runtime", + "Page", + "DOM" + ], + "types": [ + { + "id": "Annotation", + "description": "Tool annotations", + "type": "object", + "properties": [ + { + "name": "readOnly", + "description": "A hint indicating that the tool does not modify any state.", + "optional": true, + "type": "boolean" + }, + { + "name": "autosubmit", + "description": "If the declarative tool was declared with the autosubmit attribute.", + "optional": true, + "type": "boolean" + } + ] + }, + { + "id": "Tool", + "description": "Definition of a tool that can be invoked.", + "type": "object", + "properties": [ + { + "name": "name", + "description": "Tool name.", + "type": "string" + }, + { + "name": "description", + "description": "Tool description.", + "type": "string" + }, + { + "name": "inputSchema", + "description": "Schema for the tool's input parameters.", + "optional": true, + "type": "object" + }, + { + "name": "annotations", + "description": "Optional annotations for the tool.", + "optional": true, + "$ref": "Annotation" + }, + { + "name": "frameId", + "description": "Frame identifier associated with the tool registration.", + "$ref": "Page.FrameId" + }, + { + "name": "backendNodeId", + "description": "Optional node ID for declarative tools.", + "optional": true, + "$ref": "DOM.BackendNodeId" + }, + { + "name": "stackTrace", + "description": "The stack trace at the time of the registration.", + "optional": true, + "$ref": "Runtime.StackTrace" + } + ] + } + ], + "commands": [ + { + "name": "enable", + "description": "Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for\nall currently registered tools." + } + ], + "events": [ + { + "name": "toolsAdded", + "description": "Event fired when new tools are added.", + "parameters": [ + { + "name": "tools", + "description": "Array of tools that were added.", + "type": "array", + "items": { + "$ref": "Tool" + } + } + ] + }, + { + "name": "toolsRemoved", + "description": "Event fired when tools are removed.", + "parameters": [ + { + "name": "tools", + "description": "Array of tools that were removed.", + "type": "array", + "items": { + "$ref": "Tool" + } + } + ] + } + ] } ] } \ No newline at end of file diff --git a/generator/generate.py b/generator/generate.py index 8925859..e9d4d1f 100644 --- a/generator/generate.py +++ b/generator/generate.py @@ -1031,7 +1031,7 @@ def main(): # Remove generated code for subpath in output_path.iterdir(): - if subpath.is_file() and subpath.name not in ('py.typed', 'util.py', 'connection.py', '__init__.py'): + if subpath.is_file() and subpath.name not in ('py.typed', 'util.py', 'connection.py', '__init__.py') and not subpath.name.startswith('.'): subpath.unlink() # Parse domains