diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe01f629..fbcf92c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,81 +1,128 @@ -on: [push, pull_request] +name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -name: Continuous integration +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always jobs: check: - name: Check + name: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - command: check + key: rust/check + + - name: Run cargo check + run: cargo check --workspace test: - name: Test Suite - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} + name: test + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - command: test + key: rust/test - fmt: - name: Rustfmt + - name: Run tests + run: cargo test --verbose --workspace + + rust-fmt: + name: rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 + components: rustfmt + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - command: fmt - args: --all -- --check + key: rust/rustfmt + + - name: Run Rust fmt + run: cargo fmt --all -- --check clippy: - name: Clippy + name: clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 + components: clippy + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + key: rust/clippy + + - name: Build + run: cargo build --workspace + + - name: Clippy + run: cargo clippy --all-targets --all-features -- --deny warnings + + doc: + name: doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - command: clippy - args: -- -D warnings + key: rust/doc - msrv: + - name: Run cargo doc to check for warnings + run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features + + toml-fmt: + name: taplo runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install taplo + uses: taiki-e/install-action@cargo-binstall with: - profile: minimal - toolchain: "1.70.0" - override: true - - uses: actions-rs/cargo@v1 + tool: taplo-cli + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - command: check - args: --lib + key: rust/taplo + + - name: Run TOML fmt + run: taplo fmt --check diff --git a/Cargo.toml b/Cargo.toml index efad7d3c..01e95fed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chromiumoxide" version = "0.7.0" -rust-version = "1.70" +rust-version = "1.87" authors = ["Matthias Seitz "] edition = "2021" license = "MIT OR Apache-2.0" @@ -13,47 +13,48 @@ keywords = ["chrome", "chromedriver", "puppeteer", "automation"] categories = ["web-programming", "api-bindings", "development-tools::testing"] [dependencies] -async-tungstenite = "0.28.0" -serde = { version = "1", features = ["derive"] } -async-std = { version = "1", features = [ - "attributes", - "unstable", +async-tungstenite = "0.29.1" +serde = { version = "1.0.197", features = ["derive"] } +async-std = { version = "1.12.0", features = [ + "attributes", + "unstable", ], optional = true } -futures = "0.3" +futures = "0.3.31" chromiumoxide_types = { path = "chromiumoxide_types", version = "0.7" } chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.7" } chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.7", default-features = false, optional = true } -serde_json = "1" -which = "6" -thiserror = "1" -url = "2" -base64 = "0.22" -fnv = "1" -futures-timer = "3" -cfg-if = "1" -tokio = { version = "1", features = [ - "rt", - "rt-multi-thread", - "time", - "fs", - "macros", - "process", +serde_json = "1.0.114" +which = "8.0.0" +thiserror = "2.0.12" +url = "2.5.4" +base64 = "0.22.1" +fnv = "1.0.7" +futures-timer = "3.0.3" +cfg-if = "1.0.1" +tokio = { version = "1.37.0", features = [ + "rt", + "rt-multi-thread", + "time", + "fs", + "macros", + "process", ], optional = true } -tracing = "0.1" -pin-project-lite = "0.2" -dunce = "1" -bytes = { version = "1", features = ["serde"], optional = true } -reqwest = { version = "0.12", default-features = false } +tracing = "0.1.40" +pin-project-lite = "0.2.13" +dunce = "1.0.5" +bytes = { version = "1.5.0", features = ["serde"], optional = true } +reqwest = { version = "0.12.20", default-features = false } [target.'cfg(windows)'.dependencies] -winreg = "0.52" +winreg = "0.55.0" [dev-dependencies] -quote = "1" -proc-macro2 = "1" -chrono = "0.4.1" -tracing-subscriber = "0.3" -tokio = { version = "1", features = ["rt-multi-thread", "time", "macros"] } +quote = "1.0.40" +proc-macro2 = "1.0.95" +chrono = "0.4.38" +tracing-subscriber = "0.3.18" +tokio = { version = "1.37.0", features = ["rt-multi-thread", "time", "macros"] } +ureq = "3.0.12" [features] default = ["async-std-runtime", "bytes"] @@ -65,9 +66,15 @@ serde0 = [] # Temporary features until cargo weak dependencies bug is fixed # See https://github.com/rust-lang/cargo/issues/10801 -_fetcher-rustls-async-std = ["fetcher", "chromiumoxide_fetcher/_rustls-async-std"] +_fetcher-rustls-async-std = [ + "fetcher", + "chromiumoxide_fetcher/_rustls-async-std", +] _fetcher-rusttls-tokio = ["fetcher", "chromiumoxide_fetcher/_rustls-tokio"] -_fetcher-native-async-std = ["fetcher", "chromiumoxide_fetcher/_native-async-std"] +_fetcher-native-async-std = [ + "fetcher", + "chromiumoxide_fetcher/_native-async-std", +] _fetcher-native-tokio = ["fetcher", "chromiumoxide_fetcher/_native-tokio"] [[example]] @@ -100,8 +107,50 @@ required-features = ["tokio-runtime", "_fetcher-native-tokio"] [workspace] members = [ - "chromiumoxide_pdl", - "chromiumoxide_types", - "chromiumoxide_cdp", - "chromiumoxide_fetcher", + "chromiumoxide_pdl", + "chromiumoxide_types", + "chromiumoxide_cdp", + "chromiumoxide_fetcher", ] + +[workspace.dependencies] +# Core dependencies +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.114" +thiserror = "2.0.12" +anyhow = "1.0.86" +either = "1.15.0" + +# Async runtime dependencies +async-std = { version = "1.12.0", features = ["attributes", "unstable"] } +tokio = { version = "1.37.0", features = [ + "rt", + "rt-multi-thread", + "time", + "fs", + "macros", + "process", +] } +futures = "0.3.31" + +# Web and networking +reqwest = { version = "0.12.20", default-features = false } +surf = { version = "2.3.2", default-features = false } +ureq = "3.0.12" + +# File and system utilities +directories = "6.0.0" +os_info = { version = "3.12.0", default-features = false } +zip = { version = "4.2.0", default-features = false, features = ["deflate"] } +tempfile = "3.20.0" + +# Parsing and code generation +regex = "1.11.1" +quote = "1.0.40" +proc-macro2 = "1.0.95" +heck = "0.5.0" +once_cell = "1.21.3" + +# Development dependencies +chrono = "0.4.38" +tracing-subscriber = "0.3.18" diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index fd055e49..d0f1487b 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -3,7 +3,7 @@ name = "chromiumoxide_cdp" version = "0.7.0" authors = ["Matthias Seitz "] edition = "2021" -rust-version = "1.70" +rust-version = "1.87" description = "Contains all the generated types for chromiumoxide" license = "MIT OR Apache-2.0" homepage = "https://github.com/mattsse/chromiumoxide" @@ -16,11 +16,11 @@ serde0 = [] [dev-dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.7" } -ureq = "2.10.0" -tempfile = "3.10.1" +ureq = { workspace = true } +tempfile = { workspace = true } [dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.7" } chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.7" } -serde = { version = "1", features = ["derive"] } -serde_json = "1" +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } diff --git a/chromiumoxide_cdp/browser_protocol.pdl b/chromiumoxide_cdp/browser_protocol.pdl index 6f07fe34..f5bc1b95 100644 --- a/chromiumoxide_cdp/browser_protocol.pdl +++ b/chromiumoxide_cdp/browser_protocol.pdl @@ -117,6 +117,7 @@ experimental domain Accessibility # - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling. type AXPropertyName extends string enum + actions busy disabled editable @@ -498,8 +499,8 @@ experimental domain Audits type AffectedRequest extends object properties # The unique request id. - Network.RequestId requestId - optional string url + optional Network.RequestId requestId + string url # Information about the frame affected by an inspector issue. type AffectedFrame extends object @@ -517,6 +518,8 @@ experimental domain Audits ExcludeDomainNonASCII ExcludeThirdPartyCookieBlockedInFirstPartySet ExcludeThirdPartyPhaseout + ExcludePortMismatch + ExcludeSchemeMismatch type CookieWarningReason extends string enum @@ -532,12 +535,35 @@ experimental domain Audits WarnDomainNonASCII WarnThirdPartyPhaseout WarnCrossSiteRedirectDowngradeChangesInclusion + WarnDeprecationTrialMetadata + WarnThirdPartyCookieHeuristic type CookieOperation extends string enum SetCookie ReadCookie + # Represents the category of insight that a cookie issue falls under. + type InsightType extends string + enum + # Cookie domain has an entry in third-party cookie migration readiness + # list: + # https://github.com/privacysandbox/privacy-sandbox-dev-support/blob/main/3pc-migration-readiness.md + GitHubResource + # Cookie is exempted due to a grace period: + # https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period + GracePeriod + # Cookie is exempted due a heuristics-based exemptiuon: + # https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/heuristics-based-exception + Heuristics + + # Information about the suggested solution to a cookie issue. + type CookieIssueInsight extends object + properties + InsightType type + # Link to table entry in third-party cookie migration readiness list. + optional string tableEntryUrl + # This information is currently necessary, as the front-end has a difficult # time finding a specific cookie. With this, we can convey specific error # information without the cookie. @@ -557,6 +583,8 @@ experimental domain Audits optional string siteForCookies optional string cookieUrl optional AffectedRequest request + # The recommended solution to the issue. + optional CookieIssueInsight insight type MixedContentResolutionStatus extends string enum @@ -626,6 +654,7 @@ experimental domain Audits CorpNotSameOriginAfterDefaultedToSameOriginByDip CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip CorpNotSameSite + SRIMessageSignatureMismatch # Details for a request that has been blocked with the BLOCKED_BY_RESPONSE # code. Currently only used for COEP/COOP, but may be extended to include @@ -662,6 +691,7 @@ experimental domain Audits kInlineViolation kEvalViolation kURLViolation + kSRIViolation kTrustedTypesSinkViolation kTrustedTypesPolicyViolation kWasmEvalViolation @@ -771,6 +801,30 @@ experimental domain Audits WriteErrorTooLongIdField WriteErrorUnsupportedType + type SRIMessageSignatureError extends string + enum + MissingSignatureHeader + MissingSignatureInputHeader + InvalidSignatureHeader + InvalidSignatureInputHeader + SignatureHeaderValueIsNotByteSequence + SignatureHeaderValueIsParameterized + SignatureHeaderValueIsIncorrectLength + SignatureInputHeaderMissingLabel + SignatureInputHeaderValueNotInnerList + SignatureInputHeaderValueMissingComponents + SignatureInputHeaderInvalidComponentType + SignatureInputHeaderInvalidComponentName + SignatureInputHeaderInvalidHeaderComponentParameter + SignatureInputHeaderInvalidDerivedComponentParameter + SignatureInputHeaderKeyIdLength + SignatureInputHeaderInvalidParameter + SignatureInputHeaderMissingRequiredParameters + ValidationFailedSignatureExpired + ValidationFailedInvalidLength + ValidationFailedSignatureMismatch + ValidationFailedIntegrityMismatch + # Details for issues around "Attribution Reporting API" usage. # Explainer: https://github.com/WICG/attribution-reporting-api type AttributionReportingIssueDetails extends object @@ -802,6 +856,13 @@ experimental domain Audits SharedDictionaryError sharedDictionaryError AffectedRequest request + type SRIMessageSignatureIssueDetails extends object + properties + SRIMessageSignatureError error + string signatureBase + array of string integrityAssertions + AffectedRequest request + type GenericIssueErrorType extends string enum FormLabelForNameError @@ -916,10 +977,13 @@ experimental domain Audits ThirdPartyCookiesBlocked NotSignedInWithIdp MissingTransientUserActivation - ReplacedByButtonMode + ReplacedByActiveMode InvalidFieldsSpecified RelyingPartyOriginIsOpaque TypeNotMatching + UiDismissedNoEmbargo + CorsError + SuppressedBySegmentationPlatform type FederatedAuthUserInfoRequestIssueDetails extends object properties @@ -955,6 +1019,33 @@ experimental domain Audits string failureMessage optional Network.RequestId requestId + type PartitioningBlobURLInfo extends string + enum + BlockedCrossPartitionFetching + EnforceNoopenerForNavigation + + type PartitioningBlobURLIssueDetails extends object + properties + # The BlobURL that failed to load. + string url + # Additional information about the Partitioning Blob URL issue. + PartitioningBlobURLInfo partitioningBlobURLInfo + + type SelectElementAccessibilityIssueReason extends string + enum + DisallowedSelectChild + DisallowedOptGroupChild + NonPhrasingContentOptionChild + InteractiveContentOptionChild + InteractiveContentLegendChild + + # This issue warns about errors in the select element content model. + type SelectElementAccessibilityIssueDetails extends object + properties + DOM.BackendNodeId nodeId + SelectElementAccessibilityIssueReason selectElementAccessibilityIssueReason + boolean hasDisallowedAttributes + type StyleSheetLoadingIssueReason extends string enum LateImportRule @@ -988,6 +1079,19 @@ experimental domain Audits # The value of the property rule property that failed to parse optional string propertyValue + type UserReidentificationIssueType extends string + enum + BlockedFrameNavigation + BlockedSubresource + + # This issue warns about uses of APIs that may be considered misuse to + # re-identify users. + type UserReidentificationIssueDetails extends object + properties + UserReidentificationIssueType type + # Applies to BlockedFrameNavigation and BlockedSubresource issue types. + optional AffectedRequest request + # A unique identifier for the type of issue. Each type may use one of the # optional fields in InspectorIssueDetails to convey more specific # information about the kind of issue. @@ -1003,6 +1107,7 @@ experimental domain Audits CorsIssue AttributionReportingIssue QuirksModeIssue + PartitioningBlobURLIssue # Deprecated NavigatorUserAgentIssue GenericIssue @@ -1015,6 +1120,9 @@ experimental domain Audits FederatedAuthUserInfoRequestIssue PropertyRuleIssue SharedDictionaryIssue + SelectElementAccessibilityIssue + SRIMessageSignatureIssue + UserReidentificationIssue # This struct holds a list of optional fields with additional information # specific to the kind of issue. When adding a new issue code, please also @@ -1031,6 +1139,7 @@ experimental domain Audits optional CorsIssueDetails corsIssueDetails optional AttributionReportingIssueDetails attributionReportingIssueDetails optional QuirksModeIssueDetails quirksModeIssueDetails + optional PartitioningBlobURLIssueDetails partitioningBlobURLIssueDetails deprecated optional NavigatorUserAgentIssueDetails navigatorUserAgentIssueDetails optional GenericIssueDetails genericIssueDetails optional DeprecationIssueDetails deprecationIssueDetails @@ -1042,6 +1151,9 @@ experimental domain Audits optional PropertyRuleIssueDetails propertyRuleIssueDetails optional FederatedAuthUserInfoRequestIssueDetails federatedAuthUserInfoRequestIssueDetails optional SharedDictionaryIssueDetails sharedDictionaryIssueDetails + optional SelectElementAccessibilityIssueDetails selectElementAccessibilityIssueDetails + optional SRIMessageSignatureIssueDetails sriMessageSignatureIssueDetails + optional UserReidentificationIssueDetails userReidentificationIssueDetails # A unique id for a DevTools inspector issue. Allows other entities (e.g. # exceptions, CDP message, console messages, etc.) to reference an issue. @@ -1124,6 +1236,13 @@ experimental domain Extensions returns # Extension id. string id + # Uninstalls an unpacked extension (others not supported) from the profile. + # Available if the client is connected using the --remote-debugging-pipe flag + # and the --enable-unsafe-extension-debugging. + command uninstall + parameters + # Extension id. + string id # Gets data from extension storage in the given `storageArea`. If `keys` is # specified, these are used to filter the result. command getStorageItems @@ -1365,35 +1484,42 @@ domain Browser experimental type PermissionType extends string enum - accessibilityEvents + ar audioCapture - backgroundSync + automaticFullscreen backgroundFetch + backgroundSync + cameraPanTiltZoom capturedSurfaceControl clipboardReadWrite clipboardSanitizedWrite displayCapture durableStorage - flash geolocation + handTracking idleDetection + keyboardLock localFonts + localNetworkAccess midi midiSysex nfc notifications paymentHandler periodicBackgroundSync + pointerLock protectedMediaIdentifier sensors - storageAccess + smartCard speakerSelection + storageAccess topLevelStorageAccess videoCapture - videoCapturePanTiltZoom + vr wakeLockScreen wakeLockSystem webAppInstallation + webPrinting windowManagement experimental type PermissionSetting extends string @@ -1426,6 +1552,7 @@ domain Browser enum openTabSearch closeTabSearch + openGlic # Set permission settings for given origin. experimental command setPermission @@ -1507,6 +1634,10 @@ domain Browser inProgress completed canceled + # If download is "completed", provides the path of the downloaded file. + # Depending on the platform, it is not guaranteed to be set, nor the file + # is guaranteed to exist. + experimental optional string filePath # Close browser gracefully. command close @@ -1634,6 +1765,25 @@ domain Browser parameters string url + experimental type PrivacySandboxAPI extends string + enum + BiddingAndAuctionServices + TrustedKeyValue + + # Configures encryption keys used with a given privacy sandbox API to talk + # to a trusted coordinator. Since this is intended for test automation only, + # coordinatorOrigin must be a .test domain. No existing coordinator + # configuration for the origin may exist. + command addPrivacySandboxCoordinatorKeyConfig + parameters + PrivacySandboxAPI api + string coordinatorOrigin + string keyConfig + # BrowserContext to perform the action in. When omitted, default browser + # context is used. + optional BrowserContextID browserContextId + + # This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) # have an associated `id` used in subsequent operations on the related object. Each object type has # a specific `id` structure, and those are not interchangeable between objects of different kinds. @@ -1666,6 +1816,14 @@ experimental domain CSS # Matches of CSS rules applicable to the pseudo style. array of RuleMatch matches + # CSS style coming from animations with the name of the animation. + type CSSAnimationStyle extends object + properties + # The name of the animation. + optional string name + # The style coming from the animation. + CSSStyle style + # Inherited CSS rule collection from ancestor node. type InheritedStyleEntry extends object properties @@ -1674,6 +1832,14 @@ experimental domain CSS # Matches of CSS rules matching the ancestor node in the style inheritance chain. array of RuleMatch matchedCSSRules + # Inherited CSS style collection for animated styles from ancestor node. + type InheritedAnimatedStyleEntry extends object + properties + # Styles coming from the animations of the ancestor, if any, in the style inheritance chain. + optional array of CSSAnimationStyle animationStyles + # The style coming from the transitions of the ancestor, if any, in the style inheritance chain. + optional CSSStyle transitionsStyle + # Inherited pseudo element matches from pseudos of an ancestor node. type InheritedPseudoElementMatches extends object properties @@ -1796,6 +1962,9 @@ experimental domain CSS experimental optional array of CSSScope scopes # The array keeps the types of ancestor CSSRules from the innermost going outwards. experimental optional array of CSSRuleType ruleTypes + # @starting-style CSS at-rule array. + # The array enumerates @starting-style at-rules starting with the innermost one, going outwards. + experimental optional array of CSSStartingStyle startingStyles # Enum indicating the type of a CSS rule, used to represent the order of a style rule's ancestors. # This list only contains rule types that are collected during the ancestor rule collection. @@ -1807,6 +1976,7 @@ experimental domain CSS LayerRule ScopeRule StyleRule + StartingStyleRule # CSS coverage information. type RuleUsage extends object @@ -1949,6 +2119,8 @@ experimental domain CSS optional DOM.PhysicalAxes physicalAxes # Optional logical axes queried for the container. optional DOM.LogicalAxes logicalAxes + # true if the query contains scroll-state() queries. + optional boolean queriesScrollState # CSS Supports at-rule descriptor. experimental type CSSSupports extends object @@ -1985,6 +2157,15 @@ experimental domain CSS # Identifier of the stylesheet containing this object (if exists). optional StyleSheetId styleSheetId + # CSS Starting Style at-rule descriptor. + experimental type CSSStartingStyle extends object + properties + # The associated rule header range in the enclosing stylesheet (if + # available). + optional SourceRange range + # Identifier of the stylesheet containing this object (if exists). + optional StyleSheetId styleSheetId + # CSS Layer data. experimental type CSSLayerData extends object properties @@ -2115,6 +2296,51 @@ experimental domain CSS # Associated style declaration. CSSStyle style + # CSS function argument representation. + type CSSFunctionParameter extends object + properties + # The parameter name. + string name + # The parameter type. + string type + + # CSS function conditional block representation. + type CSSFunctionConditionNode extends object + properties + # Media query for this conditional block. Only one type of condition should be set. + optional CSSMedia media + # Container query for this conditional block. Only one type of condition should be set. + optional CSSContainerQuery containerQueries + # @supports CSS at-rule condition. Only one type of condition should be set. + optional CSSSupports supports + # Block body. + array of CSSFunctionNode children + # The condition text. + string conditionText + + # Section of the body of a CSS function rule. + type CSSFunctionNode extends object + properties + # A conditional block. If set, style should not be set. + optional CSSFunctionConditionNode condition + # Values set by this node. If set, condition should not be set. + optional CSSStyle style + + # CSS function at-rule representation. + type CSSFunctionRule extends object + properties + # Name of the function. + Value name + # The css style sheet identifier (absent for user agent stylesheet and user-specified + # stylesheet rules) this rule came from. + optional StyleSheetId styleSheetId + # Parent stylesheet's origin. + StyleSheetOrigin origin + # List of parameters. + array of CSSFunctionParameter parameters + # Function body. + array of CSSFunctionNode children + # CSS keyframe rule representation. type CSSKeyframeRule extends object properties @@ -2169,6 +2395,11 @@ experimental domain CSS parameters # Identifier of the frame where "via-inspector" stylesheet should be created. Page.FrameId frameId + # If true, creates a new stylesheet for every call. If false, + # returns a stylesheet previously created by a call with force=false + # for the frame's document if it exists or creates a new stylesheet + # (default: false). + optional boolean force returns # Identifier of the created "via-inspector" stylesheet. StyleSheetId styleSheetId @@ -2189,6 +2420,14 @@ experimental domain CSS # Element pseudo classes to force when computing the element's style. array of string forcedPseudoClasses + # Ensures that the given node is in its starting-style state. + command forceStartingStyle + parameters + # The element id for which to force the starting-style state. + DOM.NodeId nodeId + # Boolean indicating if this is on or off. + boolean forced + command getBackgroundColors parameters # Id of the node to get background colors for. @@ -2214,6 +2453,39 @@ experimental domain CSS # Computed style for the specified DOM node. array of CSSComputedStyleProperty computedStyle + # Resolve the specified values in the context of the provided element. + # For example, a value of '1em' is evaluated according to the computed + # 'font-size' of the element and a value 'calc(1px + 2px)' will be + # resolved to '3px'. + # If the `propertyName` was specified the `values` are resolved as if + # they were property's declaration. If a value cannot be parsed according + # 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. + experimental command resolveValues + parameters + # Substitution functions (var()/env()/attr()) and cascade-dependent + # keywords (revert/revert-layer) do not work. + array of string values + # Id of the node in whose context the expression is evaluated + DOM.NodeId nodeId + # Only longhands and custom property names are accepted. + optional string propertyName + # Pseudo element type, only works for pseudo elements that generate + # elements in the tree, such as ::before and ::after. + optional DOM.PseudoType pseudoType + # Pseudo element custom ident. + optional string pseudoIdentifier + returns + array of string results + + experimental command getLonghandProperties + parameters + string shorthandName + string value + returns + array of CSSProperty longhandProperties + # Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM # attributes) for a DOM node identified by `nodeId`. command getInlineStylesForNode @@ -2225,6 +2497,20 @@ experimental domain CSS # Attribute-defined element style (e.g. resulting from "width=20 height=100%"). optional CSSStyle attributesStyle + # Returns the styles coming from animations & transitions + # including the animation & transition styles coming from inheritance chain. + experimental command getAnimatedStylesForNode + parameters + DOM.NodeId nodeId + returns + # Styles coming from animations. + optional array of CSSAnimationStyle animationStyles + # Style coming from transitions. + optional CSSStyle transitionsStyle + # Inherited style entries for animationsStyle and transitionsStyle from + # the inheritance chain of the element. + optional array of InheritedAnimatedStyleEntry inherited + # Returns requested styles for a DOM node identified by `nodeId`. command getMatchedStylesForNode parameters @@ -2257,6 +2543,8 @@ experimental domain CSS optional CSSFontPaletteValuesRule cssFontPaletteValuesRule # Id of the first parent element that does not have display: contents. experimental optional DOM.NodeId parentLayoutNodeId + # A list of CSS at-function rules referenced by styles of this node. + experimental optional array of CSSFunctionRule cssFunctionRules # Returns all media queries parsed by the rendering engine. command getMediaQueries @@ -2299,6 +2587,16 @@ experimental domain CSS returns array of SourceRange ranges + # Starts tracking the given node for the computed style updates + # and whenever the computed style is updated for node, it queues + # a `computedStyleUpdated` event with throttling. + # There can only be 1 node tracked for computed style updates + # so passing a new node id removes tracking from the previous node. + # Pass `undefined` to disable tracking. + experimental command trackComputedStyleUpdatesForNode + parameters + optional DOM.NodeId nodeId + # Starts tracking the given computed styles for updates. The specified array of properties # replaces the one previously specified. Pass empty array to disable tracking. # Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. @@ -2466,6 +2764,11 @@ experimental domain CSS # Identifier of the removed stylesheet. StyleSheetId styleSheetId + experimental event computedStyleUpdated + parameters + # The node id that has updated computed styles. + DOM.NodeId nodeId + experimental domain CacheStorage depends on Storage @@ -2675,8 +2978,10 @@ domain DOM enum first-line first-letter + checkmark before after + picker-icon marker backdrop column @@ -2689,8 +2994,7 @@ domain DOM first-line-inherited scroll-marker scroll-marker-group - scroll-next-button - scroll-prev-button + scroll-button scrollbar scrollbar-thumb scrollbar-button @@ -2707,9 +3011,8 @@ domain DOM placeholder file-selector-button details-content - select-fallback-button - select-fallback-button-text picker + permission-icon # Shadow root type. type ShadowRootType extends string @@ -3213,6 +3516,11 @@ domain DOM # Get the popover target for a given element. In this case, this given # element can only be an HTMLFormControlElement (,