diff --git a/ed/cddl/at-driver-local.cddl b/ed/cddl/at-driver-local.cddl deleted file mode 100644 index 7f11ffc58486..000000000000 --- a/ed/cddl/at-driver-local.cddl +++ /dev/null @@ -1,90 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: AT Driver (https://w3c.github.io/at-driver/) - -Message = ( - CommandResponse // - ErrorResponse // - Event -) - -CommandResponse = { - id: uint, - result: ResultData, - Extensible, -} - -ErrorResponse = { - id: uint / null, - error: "unknown error" / "unknown command" / "invalid argument" / "session not created", - message: text, - ?stacktrace: text, - Extensible, -} - -ResultData = ( - EmptyResult / - SessionResult / - SettingsResult -) - -EmptyResult = {} - -Event = { - EventData, - Extensible, -} - -EventData = ( - InteractionEvent -) - -Extensible = { - *text => any -} - -SessionResult = (SessionNewResult) - -CapabilitiesRequest = { - ?atName: text, - ?atVersion: text, - ?platformName: text, - Extensible, -} - -SessionNewResult = { - sessionId: text, - capabilities: { - atName: text, - atVersion: text, - platformName: text, - Extensible, - } -} - -SettingsResult = { - SettingsGetSettingsResult -} - -SettingsGetSettingsResult = { - settings: [1* SettingsGetSettingsResultItem ], -} - -SettingsGetSettingsResultItem = { - name: text, - value: any, - Extensible, -} - -InteractionEvent = (InteractionCapturedOutputEvent) - -InteractionCapturedOutputParameters = { - data: text, - Extensible, -} - -InteractionCapturedOutputEvent = { - method: "interaction.capturedOutput", - params: InteractionCapturedOutputParameters -} diff --git a/ed/cddl/at-driver-remote.cddl b/ed/cddl/at-driver-remote.cddl deleted file mode 100644 index ee93b03de012..000000000000 --- a/ed/cddl/at-driver-remote.cddl +++ /dev/null @@ -1,106 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: AT Driver (https://w3c.github.io/at-driver/) - -Command = { - id: uint, - CommandData, - Extensible, -} - -CommandData = ( - SessionCommand // - SettingsCommand // - InteractionCommand -) - -EmptyParams = { Extensible } - -Extensible = { - *text => any -} - -SessionCommand = (SessionNewCommand) - -CapabilitiesRequest = { - ?atName: text, - ?atVersion: text, - ?platformName: text, - Extensible, -} - -SessionNewCommand = { - method: "session.new", - params: {capabilities: CapabilitiesRequestParameters}, -} - -CapabilitiesRequestParameters = { - ?alwaysMatch: CapabilitiesRequest, -} - -SettingsCommand = { - SettingsSetSettingsCommand // - SettingsGetSettingsCommand // - SettingsGetSupportedSettingsCommand -} - -SettingsSetSettingsCommand = { - method: "settings.setSettings", - params: SettingsSetSettingsParameters -} - -SettingsSetSettingsParameters = { - settings: [1* SettingsSetSettingsParametersItem ], -} - -SettingsSetSettingsParametersItem = { - name: text, - value: any, - Extensible, -} - -SettingsGetSettingsCommand = { - method: "settings.getSettings", - params: SettingsGetSettingsParameters -} - -SettingsGetSettingsParameters = { - settings: [1* SettingsGetSettingsParametersItem ], -} - -SettingsGetSettingsParametersItem = { - name: text, - Extensible, -} - -SettingsGetSupportedSettingsCommand = { - method: "settings.getSupportedSettings", - params: EmptyParams -} - -InteractionCommand = (InteractionUserIntentCommand) - -InteractionUserIntentCommand = { - method: "interaction.userIntent", - params: InteractionUserIntentParameters -} - -InteractionUserIntentParameters = ( - PressKeysIntentParameters / - ExtensionIntentParameters -) - -PressKeysIntentParameters = { - "name" => "pressKeys", - "keys" => KeyCombination, -} - -KeyCombination = [ - 1* text -] - -ExtensionIntentParameters = { - "name" => text, - Extensible, -} diff --git a/ed/cddl/permissions-local.cddl b/ed/cddl/permissions-local.cddl deleted file mode 100644 index 900c1ecae480..000000000000 --- a/ed/cddl/permissions-local.cddl +++ /dev/null @@ -1,10 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: Permissions (https://w3c.github.io/permissions/) - -permissions.PermissionDescriptor = { - name: text, -} - -permissions.PermissionState = "granted" / "denied" / "prompt" diff --git a/ed/cddl/permissions-remote.cddl b/ed/cddl/permissions-remote.cddl deleted file mode 100644 index 7382a951daa3..000000000000 --- a/ed/cddl/permissions-remote.cddl +++ /dev/null @@ -1,20 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: Permissions (https://w3c.github.io/permissions/) - -PermissionsCommand = ( - permissions.setPermission -) - -permissions.setPermission = ( - method: "permissions.setPermission", - params: permissions.SetPermissionParameters -) - -permissions.SetPermissionParameters = { - descriptor: permissions.PermissionDescriptor, - state: permissions.PermissionState, - origin: text, - ? userContext: text, -} diff --git a/ed/cddl/webdriver-bidi-local.cddl b/ed/cddl/webdriver-bidi-local.cddl deleted file mode 100644 index c4ffb40b8f0f..000000000000 --- a/ed/cddl/webdriver-bidi-local.cddl +++ /dev/null @@ -1,3268 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: WebDriver BiDi (https://w3c.github.io/webdriver-bidi/) - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / -"invalid selector" / -"invalid session id" / -"invalid web extension" / -"move target out of bounds" / -"no such alert" / -"no such element" / -"no such frame" / -"no such handle" / -"no such history entry" / -"no such intercept" / -"no such node" / -"no such request" / -"no such script" / -"no such storage partition" / -"no such user context" / -"no such web extension" / -"session not created" / -"unable to capture screen" / -"unable to close browser" / -"unable to set cookie" / -"unable to set file input" / -"underspecified storage partition" / -"unknown command" / -"unknown error" / -"unsupported operation" - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.StatusResult = { - ready: bool, - message: text, -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.SubscribeResult = { - subscription: session.Subscription, -} - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / -"worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputEvent = ( - input.FileDialogOpened -) - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / - "invalid selector" / - "invalid session id" / - "invalid web extension" / - "move target out of bounds" / - "no such alert" / - "no such element" / - "no such frame" / - "no such handle" / - "no such history entry" / - "no such intercept" / - "no such node" / - "no such request" / - "no such script" / - "no such storage partition" / - "no such user context" / - "no such web extension" / - "session not created" / - "unable to capture screen" / - "unable to close browser" / - "unable to set cookie" / - "unable to set file input" / - "underspecified storage partition" / - "unknown command" / - "unknown error" / - "unsupported operation" - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.StatusResult = { - ready: bool, - message: text, -} - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.SubscribeResult = { - subscription: session.Subscription, -} - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / - "worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -InputEvent = ( - input.FileDialogOpened -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -} diff --git a/ed/cddl/webdriver-bidi-remote.cddl b/ed/cddl/webdriver-bidi-remote.cddl deleted file mode 100644 index eee6dedebc97..000000000000 --- a/ed/cddl/webdriver-bidi-remote.cddl +++ /dev/null @@ -1,3536 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: WebDriver BiDi (https://w3c.github.io/webdriver-bidi/) - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -browsingContext.BrowsingContext = text; - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Intercept = text - -network.Request = text; - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / -"worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -} - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / - "invalid selector" / - "invalid session id" / - "invalid web extension" / - "move target out of bounds" / - "no such alert" / - "no such element" / - "no such frame" / - "no such handle" / - "no such history entry" / - "no such intercept" / - "no such node" / - "no such request" / - "no such script" / - "no such storage partition" / - "no such user context" / - "no such web extension" / - "session not created" / - "unable to capture screen" / - "unable to close browser" / - "unable to set cookie" / - "unable to set file input" / - "underspecified storage partition" / - "unknown command" / - "unknown error" / - "unsupported operation" - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.StatusResult = { - ready: bool, - message: text, -} - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.SubscribeResult = { - subscription: session.Subscription, -} - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / - "worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -InputEvent = ( - input.FileDialogOpened -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -} diff --git a/tr/cddl/permissions-local.cddl b/tr/cddl/permissions-local.cddl deleted file mode 100644 index 2df121919deb..000000000000 --- a/tr/cddl/permissions-local.cddl +++ /dev/null @@ -1,10 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: Permissions (https://www.w3.org/TR/permissions/) - -permissions.PermissionDescriptor = { - name: text, -} - -permissions.PermissionState = "granted" / "denied" / "prompt" diff --git a/tr/cddl/permissions-remote.cddl b/tr/cddl/permissions-remote.cddl deleted file mode 100644 index 803005da5f46..000000000000 --- a/tr/cddl/permissions-remote.cddl +++ /dev/null @@ -1,20 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: Permissions (https://www.w3.org/TR/permissions/) - -PermissionsCommand = ( - permissions.setPermission -) - -permissions.setPermission = ( - method: "permissions.setPermission", - params: permissions.SetPermissionParameters -) - -permissions.SetPermissionParameters = { - descriptor: permissions.PermissionDescriptor, - state: permissions.PermissionState, - origin: text, - ? userContext: text, -} diff --git a/tr/cddl/webdriver-bidi-local.cddl b/tr/cddl/webdriver-bidi-local.cddl deleted file mode 100644 index 43183a356c26..000000000000 --- a/tr/cddl/webdriver-bidi-local.cddl +++ /dev/null @@ -1,3268 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: WebDriver BiDi (https://www.w3.org/TR/webdriver-bidi/) - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / -"invalid selector" / -"invalid session id" / -"invalid web extension" / -"move target out of bounds" / -"no such alert" / -"no such element" / -"no such frame" / -"no such handle" / -"no such history entry" / -"no such intercept" / -"no such node" / -"no such request" / -"no such script" / -"no such storage partition" / -"no such user context" / -"no such web extension" / -"session not created" / -"unable to capture screen" / -"unable to close browser" / -"unable to set cookie" / -"unable to set file input" / -"underspecified storage partition" / -"unknown command" / -"unknown error" / -"unsupported operation" - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.StatusResult = { - ready: bool, - message: text, -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.SubscribeResult = { - subscription: session.Subscription, -} - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / -"worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputEvent = ( - input.FileDialogOpened -) - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / - "invalid selector" / - "invalid session id" / - "invalid web extension" / - "move target out of bounds" / - "no such alert" / - "no such element" / - "no such frame" / - "no such handle" / - "no such history entry" / - "no such intercept" / - "no such node" / - "no such request" / - "no such script" / - "no such storage partition" / - "no such user context" / - "no such web extension" / - "session not created" / - "unable to capture screen" / - "unable to close browser" / - "unable to set cookie" / - "unable to set file input" / - "underspecified storage partition" / - "unknown command" / - "unknown error" / - "unsupported operation" - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.StatusResult = { - ready: bool, - message: text, -} - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.SubscribeResult = { - subscription: session.Subscription, -} - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / - "worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -InputEvent = ( - input.FileDialogOpened -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -} diff --git a/tr/cddl/webdriver-bidi-remote.cddl b/tr/cddl/webdriver-bidi-remote.cddl deleted file mode 100644 index 37e85e74f722..000000000000 --- a/tr/cddl/webdriver-bidi-remote.cddl +++ /dev/null @@ -1,3536 +0,0 @@ -; GENERATED CONTENT - DO NOT EDIT -; Content was automatically extracted by Reffy into webref -; (https://github.com/w3c/webref) -; Source: WebDriver BiDi (https://www.w3.org/TR/webdriver-bidi/) - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -browsingContext.BrowsingContext = text; - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Intercept = text - -network.Request = text; - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / -"worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -} - -Command = { - id: js-uint, - CommandData, - Extensible, -} - -CommandData = ( - BrowserCommand // - BrowsingContextCommand // - EmulationCommand // - InputCommand // - NetworkCommand // - ScriptCommand // - SessionCommand // - StorageCommand // - WebExtensionCommand -) - -EmptyParams = { - Extensible -} - -Message = ( - CommandResponse / - ErrorResponse / - Event -) - -CommandResponse = { - type: "success", - id: js-uint, - result: ResultData, - Extensible -} - -ErrorResponse = { - type: "error", - id: js-uint / null, - error: ErrorCode, - message: text, - ? stacktrace: text, - Extensible -} - -ResultData = ( - BrowsingContextResult / - EmptyResult / - NetworkResult / - ScriptResult / - SessionResult / - StorageResult / - WebExtensionResult -) - -EmptyResult = { - Extensible -} - -Event = { - type: "event", - EventData, - Extensible -} - -EventData = ( - BrowsingContextEvent // - InputEvent // - LogEvent // - NetworkEvent // - ScriptEvent -) - -Extensible = (*text => any) - -js-int = -9007199254740991..9007199254740991 -js-uint = 0..9007199254740991 - -ErrorCode = "invalid argument" / - "invalid selector" / - "invalid session id" / - "invalid web extension" / - "move target out of bounds" / - "no such alert" / - "no such element" / - "no such frame" / - "no such handle" / - "no such history entry" / - "no such intercept" / - "no such node" / - "no such request" / - "no such script" / - "no such storage partition" / - "no such user context" / - "no such web extension" / - "session not created" / - "unable to capture screen" / - "unable to close browser" / - "unable to set cookie" / - "unable to set file input" / - "underspecified storage partition" / - "unknown command" / - "unknown error" / - "unsupported operation" - -SessionCommand = ( - session.End // - session.New // - session.Status // - session.Subscribe // - session.Unsubscribe -) - -SessionResult = ( - session.NewResult / - session.StatusResult / - session.SubscribeResult -) - -session.CapabilitiesRequest = { - ? alwaysMatch: session.CapabilityRequest, - ? firstMatch: [*session.CapabilityRequest] -} - -session.CapabilityRequest = { - ? acceptInsecureCerts: bool, - ? browserName: text, - ? browserVersion: text, - ? platformName: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - Extensible -} - -session.ProxyConfiguration = { - session.AutodetectProxyConfiguration // - session.DirectProxyConfiguration // - session.ManualProxyConfiguration // - session.PacProxyConfiguration // - session.SystemProxyConfiguration -} - -session.AutodetectProxyConfiguration = ( - proxyType: "autodetect", - Extensible -) - -session.DirectProxyConfiguration = ( - proxyType: "direct", - Extensible -) - -session.ManualProxyConfiguration = ( - proxyType: "manual", - ? ftpProxy: text, - ? httpProxy: text, - ? sslProxy: text, - ? session.SocksProxyConfiguration, - ? noProxy: [*text], - Extensible -) - -session.SocksProxyConfiguration = ( - socksProxy: text, - socksVersion: 0..255, -) - -session.PacProxyConfiguration = ( - proxyType: "pac", - proxyAutoconfigUrl: text, - Extensible -) - -session.SystemProxyConfiguration = ( - proxyType: "system", - Extensible -) - -session.UserPromptHandler = { - ? alert: session.UserPromptHandlerType, - ? beforeUnload: session.UserPromptHandlerType, - ? confirm: session.UserPromptHandlerType, - ? default: session.UserPromptHandlerType, - ? file: session.UserPromptHandlerType, - ? prompt: session.UserPromptHandlerType, -} - -session.UserPromptHandlerType = "accept" / "dismiss" / "ignore"; - -session.Subscription = text - -session.SubscriptionRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -session.UnsubscribeByIDRequest = { - subscriptions: [+session.Subscription], -} - -session.UnsubscribeByAttributesRequest = { - events: [+text], - ? contexts: [+browsingContext.BrowsingContext], -} - -session.Status = ( - method: "session.status", - params: EmptyParams, -) - -session.StatusResult = { - ready: bool, - message: text, -} - -session.New = ( - method: "session.new", - params: session.NewParameters -) - -session.NewParameters = { - capabilities: session.CapabilitiesRequest -} - -session.NewResult = { - sessionId: text, - capabilities: { - acceptInsecureCerts: bool, - browserName: text, - browserVersion: text, - platformName: text, - setWindowRect: bool, - userAgent: text, - ? proxy: session.ProxyConfiguration, - ? unhandledPromptBehavior: session.UserPromptHandler, - ? webSocketUrl: text, - Extensible - } -} - -session.End = ( - method: "session.end", - params: EmptyParams -) - -session.Subscribe = ( - method: "session.subscribe", - params: session.SubscriptionRequest -) - -session.SubscribeResult = { - subscription: session.Subscription, -} - -session.Unsubscribe = ( - method: "session.unsubscribe", - params: session.UnsubscribeParameters, -) - -session.UnsubscribeParameters = session.UnsubscribeByAttributesRequest / session.UnsubscribeByIDRequest - -BrowserCommand = ( - browser.Close // - browser.CreateUserContext // - browser.GetClientWindows // - browser.GetUserContexts // - browser.RemoveUserContext // - browser.SetClientWindowState -) - -BrowserResult = ( - browser.CreateUserContextResult / - browser.GetUserContextsResult -) - -browser.ClientWindow = text; - -browser.ClientWindowInfo = { - active: bool, - clientWindow: browser.ClientWindow, - height: js-uint, - state: "fullscreen" / "maximized" / "minimized" / "normal", - width: js-uint, - x: js-int, - y: js-int, -} - -browser.UserContext = text; - -browser.UserContextInfo = { - userContext: browser.UserContext -} - -browser.Close = ( - method: "browser.close", - params: EmptyParams, -) - -browser.CreateUserContext = ( - method: "browser.createUserContext", - params: browser.CreateUserContextParameters, -) - -browser.CreateUserContextParameters = { - ? acceptInsecureCerts: bool, - ? proxy: session.ProxyConfiguration -} - -browser.CreateUserContextResult = browser.UserContextInfo - -browser.GetClientWindows = ( - method: "browser.getClientWindows", - params: EmptyParams, -) - -browser.GetClientWindowsResult = { - clientWindows: [ * browser.ClientWindowInfo] -} - -browser.GetUserContexts = ( - method: "browser.getUserContexts", - params: EmptyParams, -) - -browser.GetUserContextsResult = { - userContexts: [ + browser.UserContextInfo] -} - -browser.RemoveUserContext = ( - method: "browser.removeUserContext", - params: browser.RemoveUserContextParameters -) - -browser.RemoveUserContextParameters = { - userContext: browser.UserContext -} - -browser.SetClientWindowState = ( - method: "browser.setClientWindowState", - params: browser.SetClientWindowStateParameters -) - -browser.SetClientWindowStateParameters = { - clientWindow: browser.ClientWindow, - (browser.ClientWindowNamedState // browser.ClientWindowRectState) -} - -browser.ClientWindowNamedState = ( - state: "fullscreen" / "maximized" / "minimized" -) - -browser.ClientWindowRectState = ( - state: "normal", - ? width: js-uint, - ? height: js-uint, - ? x: js-int, - ? y: js-int, -) - -BrowsingContextCommand = ( - browsingContext.Activate // - browsingContext.CaptureScreenshot // - browsingContext.Close // - browsingContext.Create // - browsingContext.GetTree // - browsingContext.HandleUserPrompt // - browsingContext.LocateNodes // - browsingContext.Navigate // - browsingContext.Print // - browsingContext.Reload // - browsingContext.SetViewport // - browsingContext.TraverseHistory -) - -BrowsingContextResult = ( - browsingContext.CaptureScreenshotResult / - browsingContext.CreateResult / - browsingContext.GetTreeResult / - browsingContext.LocateNodesResult / - browsingContext.NavigateResult / - browsingContext.PrintResult / - browsingContext.TraverseHistoryResult -) - -BrowsingContextEvent = ( - browsingContext.ContextCreated // - browsingContext.ContextDestroyed // - browsingContext.DomContentLoaded // - browsingContext.DownloadEnd // - browsingContext.DownloadWillBegin // - browsingContext.FragmentNavigated // - browsingContext.HistoryUpdated // - browsingContext.Load // - browsingContext.NavigationAborted // - browsingContext.NavigationCommitted // - browsingContext.NavigationFailed // - browsingContext.NavigationStarted // - browsingContext.UserPromptClosed // - browsingContext.UserPromptOpened -) - -browsingContext.BrowsingContext = text; - -browsingContext.InfoList = [*browsingContext.Info] - -browsingContext.Info = { - children: browsingContext.InfoList / null, - clientWindow: browser.ClientWindow, - context: browsingContext.BrowsingContext, - originalOpener: browsingContext.BrowsingContext / null, - url: text, - userContext: browser.UserContext, - ? parent: browsingContext.BrowsingContext / null, -} - -browsingContext.Locator = ( - browsingContext.AccessibilityLocator / - browsingContext.CssLocator / - browsingContext.ContextLocator / - browsingContext.InnerTextLocator / - browsingContext.XPathLocator -) - -browsingContext.AccessibilityLocator = { - type: "accessibility", - value: { - ? name: text, - ? role: text, - } -} - -browsingContext.CssLocator = { - type: "css", - value: text -} - -browsingContext.ContextLocator = { - type: "context", - value: { - context: browsingContext.BrowsingContext, - } -} - -browsingContext.InnerTextLocator = { - type: "innerText", - value: text, - ? ignoreCase: bool - ? matchType: "full" / "partial", - ? maxDepth: js-uint, -} - -browsingContext.XPathLocator = { - type: "xpath", - value: text -} - -browsingContext.Navigation = text; - -browsingContext.BaseNavigationInfo = ( - context: browsingContext.BrowsingContext, - navigation: browsingContext.Navigation / null, - timestamp: js-uint, - url: text, -) - -browsingContext.NavigationInfo = { - browsingContext.BaseNavigationInfo -} - -browsingContext.ReadinessState = "none" / "interactive" / "complete" - -browsingContext.UserPromptType = "alert" / "beforeunload" / "confirm" / "prompt"; - -browsingContext.Activate = ( - method: "browsingContext.activate", - params: browsingContext.ActivateParameters -) - -browsingContext.ActivateParameters = { - context: browsingContext.BrowsingContext -} - -browsingContext.CaptureScreenshot = ( - method: "browsingContext.captureScreenshot", - params: browsingContext.CaptureScreenshotParameters -) - -browsingContext.CaptureScreenshotParameters = { - context: browsingContext.BrowsingContext, - ? origin: ("viewport" / "document") .default "viewport", - ? format: browsingContext.ImageFormat, - ? clip: browsingContext.ClipRectangle, -} - -browsingContext.ImageFormat = { - type: text, - ? quality: 0.0..1.0, -} - -browsingContext.ClipRectangle = ( - browsingContext.BoxClipRectangle / - browsingContext.ElementClipRectangle -) - -browsingContext.ElementClipRectangle = { - type: "element", - element: script.SharedReference -} - -browsingContext.BoxClipRectangle = { - type: "box", - x: float, - y: float, - width: float, - height: float -} - -browsingContext.CaptureScreenshotResult = { - data: text -} - -browsingContext.Close = ( - method: "browsingContext.close", - params: browsingContext.CloseParameters -) - -browsingContext.CloseParameters = { - context: browsingContext.BrowsingContext, - ? promptUnload: bool .default false -} - -browsingContext.Create = ( - method: "browsingContext.create", - params: browsingContext.CreateParameters -) - -browsingContext.CreateType = "tab" / "window" - -browsingContext.CreateParameters = { - type: browsingContext.CreateType, - ? referenceContext: browsingContext.BrowsingContext, - ? background: bool .default false, - ? userContext: browser.UserContext -} - -browsingContext.CreateResult = { - context: browsingContext.BrowsingContext -} - -browsingContext.GetTree = ( - method: "browsingContext.getTree", - params: browsingContext.GetTreeParameters -) - -browsingContext.GetTreeParameters = { - ? maxDepth: js-uint, - ? root: browsingContext.BrowsingContext, -} - -browsingContext.GetTreeResult = { - contexts: browsingContext.InfoList -} - -browsingContext.HandleUserPrompt = ( - method: "browsingContext.handleUserPrompt", - params: browsingContext.HandleUserPromptParameters -) - -browsingContext.HandleUserPromptParameters = { - context: browsingContext.BrowsingContext, - ? accept: bool, - ? userText: text, -} - -browsingContext.LocateNodes = ( - method: "browsingContext.locateNodes", - params: browsingContext.LocateNodesParameters -) - -browsingContext.LocateNodesParameters = { - context: browsingContext.BrowsingContext, - locator: browsingContext.Locator, - ? maxNodeCount: (js-uint .ge 1), - ? serializationOptions: script.SerializationOptions, - ? startNodes: [ + script.SharedReference ] -} - -browsingContext.LocateNodesResult = { - nodes: [ * script.NodeRemoteValue ] -} - -browsingContext.Navigate = ( - method: "browsingContext.navigate", - params: browsingContext.NavigateParameters -) - -browsingContext.NavigateParameters = { - context: browsingContext.BrowsingContext, - url: text, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.NavigateResult = { - navigation: browsingContext.Navigation / null, - url: text, -} - -browsingContext.Print = ( - method: "browsingContext.print", - params: browsingContext.PrintParameters -) - -browsingContext.PrintParameters = { - context: browsingContext.BrowsingContext, - ? background: bool .default false, - ? margin: browsingContext.PrintMarginParameters, - ? orientation: ("portrait" / "landscape") .default "portrait", - ? page: browsingContext.PrintPageParameters, - ? pageRanges: [*(js-uint / text)], - ? scale: (0.1..2.0) .default 1.0, - ? shrinkToFit: bool .default true, -} - -browsingContext.PrintMarginParameters = { - ? bottom: (float .ge 0.0) .default 1.0, - ? left: (float .ge 0.0) .default 1.0, - ? right: (float .ge 0.0) .default 1.0, - ? top: (float .ge 0.0) .default 1.0, -} - -; Minimum size is 1pt x 1pt. Conversion follows from -; https://www.w3.org/TR/css3-values/#absolute-lengths -browsingContext.PrintPageParameters = { - ? height: (float .ge 0.0352) .default 27.94, - ? width: (float .ge 0.0352) .default 21.59, -} - -browsingContext.PrintResult = { - data: text -} - -browsingContext.Reload = ( - method: "browsingContext.reload", - params: browsingContext.ReloadParameters -) - -browsingContext.ReloadParameters = { - context: browsingContext.BrowsingContext, - ? ignoreCache: bool, - ? wait: browsingContext.ReadinessState, -} - -browsingContext.SetViewport = ( - method: "browsingContext.setViewport", - params: browsingContext.SetViewportParameters -) - -browsingContext.SetViewportParameters = { - ? context: browsingContext.BrowsingContext, - ? viewport: browsingContext.Viewport / null, - ? devicePixelRatio: (float .gt 0.0) / null, - ? userContexts: [+browser.UserContext], -} - -browsingContext.Viewport = { - width: js-uint, - height: js-uint, -} - -browsingContext.TraverseHistory = ( - method: "browsingContext.traverseHistory", - params: browsingContext.TraverseHistoryParameters -) - -browsingContext.TraverseHistoryParameters = { - context: browsingContext.BrowsingContext, - delta: js-int, -} - -browsingContext.TraverseHistoryResult = { -} - -browsingContext.ContextCreated = ( - method: "browsingContext.contextCreated", - params: browsingContext.Info -) - -browsingContext.ContextDestroyed = ( - method: "browsingContext.contextDestroyed", - params: browsingContext.Info -) - -browsingContext.NavigationStarted = ( - method: "browsingContext.navigationStarted", - params: browsingContext.NavigationInfo -) - -browsingContext.FragmentNavigated = ( - method: "browsingContext.fragmentNavigated", - params: browsingContext.NavigationInfo -) - -browsingContext.HistoryUpdated = ( - method: "browsingContext.historyUpdated", - params: browsingContext.HistoryUpdatedParameters -) - -browsingContext.HistoryUpdatedParameters = { - context: browsingContext.BrowsingContext, - timestamp: js-uint, - url: text -} - -browsingContext.DomContentLoaded = ( - method: "browsingContext.domContentLoaded", - params: browsingContext.NavigationInfo -) - -browsingContext.Load = ( - method: "browsingContext.load", - params: browsingContext.NavigationInfo -) - -browsingContext.DownloadWillBegin = ( - method: "browsingContext.downloadWillBegin", - params: browsingContext.DownloadWillBeginParams -) - -browsingContext.DownloadWillBeginParams = { - suggestedFilename: text, - browsingContext.BaseNavigationInfo -} - -browsingContext.DownloadEnd = ( - method: "browsingContext.downloadEnd", - params: browsingContext.DownloadEndParams -) - -browsingContext.DownloadEndParams = { - ( - browsingContext.DownloadCanceledParams // - browsingContext.DownloadCompleteParams - ) -} - -browsingContext.DownloadCanceledParams = ( - status: "canceled", - browsingContext.BaseNavigationInfo -) - -browsingContext.DownloadCompleteParams = ( - status: "complete", - filepath: text / null, - browsingContext.BaseNavigationInfo -) - -browsingContext.NavigationAborted = ( - method: "browsingContext.navigationAborted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationCommitted = ( - method: "browsingContext.navigationCommitted", - params: browsingContext.NavigationInfo -) - -browsingContext.NavigationFailed = ( - method: "browsingContext.navigationFailed", - params: browsingContext.NavigationInfo -) - -browsingContext.UserPromptClosed = ( - method: "browsingContext.userPromptClosed", - params: browsingContext.UserPromptClosedParameters -) - -browsingContext.UserPromptClosedParameters = { - context: browsingContext.BrowsingContext, - accepted: bool, - type: browsingContext.UserPromptType, - ? userText: text -} - -browsingContext.UserPromptOpened = ( - method: "browsingContext.userPromptOpened", - params: browsingContext.UserPromptOpenedParameters -) - -browsingContext.UserPromptOpenedParameters = { - context: browsingContext.BrowsingContext, - handler: session.UserPromptHandlerType, - message: text, - type: browsingContext.UserPromptType, - ? defaultValue: text -} - -EmulationCommand = ( - emulation.SetGeolocationOverride -) - -emulation.SetGeolocationOverride = ( - method: "emulation.setGeolocationOverride", - params: emulation.SetGeolocationOverrideParameters -) - -emulation.SetGeolocationOverrideParameters = { - ( - (coordinates: emulation.GeolocationCoordinates / null) // - (error: emulation.GeolocationPositionError) - ), - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], -} - -emulation.GeolocationCoordinates = { - latitude: -90.0..90.0, - longitude: -180.0..180.0, - ? accuracy: (float .ge 0.0) .default 1.0, - ? altitude: float / null .default null, - ? altitudeAccuracy: (float .ge 0.0) / null .default null, - ? heading: (0.0...360.0) / null .default null, - ? speed: (float .ge 0.0) / null .default null, -} - -emulation.GeolocationPositionError = { - type: "positionUnavailable" -} - -NetworkCommand = ( - network.AddIntercept // - network.ContinueRequest // - network.ContinueResponse // - network.ContinueWithAuth // - network.FailRequest // - network.ProvideResponse // - network.RemoveIntercept // - network.SetCacheBehavior -) - -NetworkResult = ( - network.AddInterceptResult -) - -NetworkEvent = ( - network.AuthRequired // - network.BeforeRequestSent // - network.FetchError // - network.ResponseCompleted // - network.ResponseStarted -) - -network.AuthChallenge = { - scheme: text, - realm: text, -} - -network.AuthCredentials = { - type: "password", - username: text, - password: text, -} - -network.BaseParameters = ( - context: browsingContext.BrowsingContext / null, - isBlocked: bool, - navigation: browsingContext.Navigation / null, - redirectCount: js-uint, - request: network.RequestData, - timestamp: js-uint, - ? intercepts: [+network.Intercept] -) - -network.BytesValue = network.StringValue / network.Base64Value; - -network.StringValue = { - type: "string", - value: text, -} - -network.Base64Value = { - type: "base64", - value: text, -} - -network.SameSite = "strict" / "lax" / "none" - -network.Cookie = { - name: text, - value: network.BytesValue, - domain: text, - path: text, - size: js-uint, - httpOnly: bool, - secure: bool, - sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -network.CookieHeader = { - name: text, - value: network.BytesValue, -} - -network.FetchTimingInfo = { - timeOrigin: float, - requestTime: float, - redirectStart: float, - redirectEnd: float, - fetchStart: float, - dnsStart: float, - dnsEnd: float, - connectStart: float, - connectEnd: float, - tlsStart: float, - requestStart: float, - responseStart: float, - responseEnd: float, -} - -network.Header = { - name: text, - value: network.BytesValue, -} - -network.Initiator = { - ? columnNumber: js-uint, - ? lineNumber: js-uint, - ? request: network.Request, - ? stackTrace: script.StackTrace, - ? type: "parser" / "script" / "preflight" / "other" -} - -network.Intercept = text - -network.Request = text; - -network.RequestData = { - request: network.Request, - url: text, - method: text, - headers: [*network.Header], - cookies: [*network.Cookie], - headersSize: js-uint, - bodySize: js-uint / null, - destination: text, - initiatorType: text / null, - timings: network.FetchTimingInfo, -} - -network.ResponseContent = { - size: js-uint -} - -network.ResponseData = { - url: text, - protocol: text, - status: js-uint, - statusText: text, - fromCache: bool, - headers: [*network.Header], - mimeType: text, - bytesReceived: js-uint, - headersSize: js-uint / null, - bodySize: js-uint / null, - content: network.ResponseContent, - ?authChallenges: [*network.AuthChallenge], -} - -network.SetCookieHeader = { - name: text, - value: network.BytesValue, - ? domain: text, - ? httpOnly: bool, - ? expiry: text, - ? maxAge: js-int, - ? path: text, - ? sameSite: network.SameSite, - ? secure: bool, -} - -network.UrlPattern = ( - network.UrlPatternPattern / - network.UrlPatternString -) - -network.UrlPatternPattern = { - type: "pattern", - ?protocol: text, - ?hostname: text, - ?port: text, - ?pathname: text, - ?search: text, -} - -network.UrlPatternString = { - type: "string", - pattern: text, -} - -network.AddIntercept = ( - method: "network.addIntercept", - params: network.AddInterceptParameters -) - -network.AddInterceptParameters = { - phases: [+network.InterceptPhase], - ? contexts: [+browsingContext.BrowsingContext], - ? urlPatterns: [*network.UrlPattern], -} - -network.InterceptPhase = "beforeRequestSent" / "responseStarted" / - "authRequired" - -network.AddInterceptResult = { - intercept: network.Intercept -} - -network.ContinueRequest = ( - method: "network.continueRequest", - params: network.ContinueRequestParameters -) - -network.ContinueRequestParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.CookieHeader], - ?headers: [*network.Header], - ?method: text, - ?url: text, -} - -network.ContinueResponse = ( - method: "network.continueResponse", - params: network.ContinueResponseParameters -) - -network.ContinueResponseParameters = { - request: network.Request, - ?cookies: [*network.SetCookieHeader] - ?credentials: network.AuthCredentials, - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.ContinueWithAuth = ( - method: "network.continueWithAuth", - params: network.ContinueWithAuthParameters -) - -network.ContinueWithAuthParameters = { - request: network.Request, - (network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials) -} - -network.ContinueWithAuthCredentials = ( - action: "provideCredentials", - credentials: network.AuthCredentials -) - -network.ContinueWithAuthNoCredentials = ( - action: "default" / "cancel" -) - -network.FailRequest = ( - method: "network.failRequest", - params: network.FailRequestParameters -) - -network.FailRequestParameters = { - request: network.Request, -} - -network.ProvideResponse = ( - method: "network.provideResponse", - params: network.ProvideResponseParameters -) - -network.ProvideResponseParameters = { - request: network.Request, - ?body: network.BytesValue, - ?cookies: [*network.SetCookieHeader], - ?headers: [*network.Header], - ?reasonPhrase: text, - ?statusCode: js-uint, -} - -network.RemoveIntercept = ( - method: "network.removeIntercept", - params: network.RemoveInterceptParameters -) - -network.RemoveInterceptParameters = { - intercept: network.Intercept -} - -network.SetCacheBehavior = ( - method: "network.setCacheBehavior", - params: network.SetCacheBehaviorParameters -) - -network.SetCacheBehaviorParameters = { - cacheBehavior: "default" / "bypass", - ? contexts: [+browsingContext.BrowsingContext] -} - -network.AuthRequired = ( - method: "network.authRequired", - params: network.AuthRequiredParameters -) - -network.AuthRequiredParameters = { - network.BaseParameters, - response: network.ResponseData -} - -network.BeforeRequestSent = ( - method: "network.beforeRequestSent", - params: network.BeforeRequestSentParameters - ) - -network.BeforeRequestSentParameters = { - network.BaseParameters, - ? initiator: network.Initiator, -} - -network.FetchError = ( - method: "network.fetchError", - params: network.FetchErrorParameters - ) - -network.FetchErrorParameters = { - network.BaseParameters, - errorText: text, -} - -network.ResponseCompleted = ( - method: "network.responseCompleted", - params: network.ResponseCompletedParameters - ) - -network.ResponseCompletedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -network.ResponseStarted = ( - method: "network.responseStarted", - params: network.ResponseStartedParameters - ) - -network.ResponseStartedParameters = { - network.BaseParameters, - response: network.ResponseData, -} - -ScriptCommand = ( - script.AddPreloadScript // - script.CallFunction // - script.Disown // - script.Evaluate // - script.GetRealms // - script.RemovePreloadScript -) - -ScriptResult = ( - script.AddPreloadScriptResult / - script.EvaluateResult / - script.GetRealmsResult -) - -ScriptEvent = ( - script.Message // - script.RealmCreated // - script.RealmDestroyed -) - -script.Channel = text; - -script.ChannelValue = { - type: "channel", - value: script.ChannelProperties, -} - -script.ChannelProperties = { - channel: script.Channel, - ? serializationOptions: script.SerializationOptions, - ? ownership: script.ResultOwnership, -} - -script.EvaluateResult = ( - script.EvaluateResultSuccess / - script.EvaluateResultException -) - -script.EvaluateResultSuccess = { - type: "success", - result: script.RemoteValue, - realm: script.Realm -} - -script.EvaluateResultException = { - type: "exception", - exceptionDetails: script.ExceptionDetails - realm: script.Realm -} - -script.ExceptionDetails = { - columnNumber: js-uint, - exception: script.RemoteValue, - lineNumber: js-uint, - stackTrace: script.StackTrace, - text: text, -} - -script.Handle = text; - -script.InternalId = text; - -script.LocalValue = ( - script.RemoteReference / - script.PrimitiveProtocolValue / - script.ChannelValue / - script.ArrayLocalValue / - { script.DateLocalValue } / - script.MapLocalValue / - script.ObjectLocalValue / - { script.RegExpLocalValue } / - script.SetLocalValue -) - -script.ListLocalValue = [*script.LocalValue]; - -script.ArrayLocalValue = { - type: "array", - value: script.ListLocalValue, -} - -script.DateLocalValue = ( - type: "date", - value: text -) - -script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]]; - -script.MapLocalValue = { - type: "map", - value: script.MappingLocalValue, -} - -script.ObjectLocalValue = { - type: "object", - value: script.MappingLocalValue, -} - -script.RegExpValue = { - pattern: text, - ? flags: text, -} - -script.RegExpLocalValue = ( - type: "regexp", - value: script.RegExpValue, -) - -script.SetLocalValue = { - type: "set", - value: script.ListLocalValue, -} - -script.PreloadScript = text; - -script.Realm = text; - -script.PrimitiveProtocolValue = ( - script.UndefinedValue / - script.NullValue / - script.StringValue / - script.NumberValue / - script.BooleanValue / - script.BigIntValue -) - -script.UndefinedValue = { - type: "undefined", -} - -script.NullValue = { - type: "null", -} - -script.StringValue = { - type: "string", - value: text, -} - -script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; - -script.NumberValue = { - type: "number", - value: number / script.SpecialNumber, -} - -script.BooleanValue = { - type: "boolean", - value: bool, -} - -script.BigIntValue = { - type: "bigint", - value: text, -} - -script.RealmInfo = ( - script.WindowRealmInfo / - script.DedicatedWorkerRealmInfo / - script.SharedWorkerRealmInfo / - script.ServiceWorkerRealmInfo / - script.WorkerRealmInfo / - script.PaintWorkletRealmInfo / - script.AudioWorkletRealmInfo / - script.WorkletRealmInfo -) - -script.BaseRealmInfo = ( - realm: script.Realm, - origin: text -) - -script.WindowRealmInfo = { - script.BaseRealmInfo, - type: "window", - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.DedicatedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "dedicated-worker", - owners: [script.Realm] -} - -script.SharedWorkerRealmInfo = { - script.BaseRealmInfo, - type: "shared-worker" -} - -script.ServiceWorkerRealmInfo = { - script.BaseRealmInfo, - type: "service-worker" -} - -script.WorkerRealmInfo = { - script.BaseRealmInfo, - type: "worker" -} - -script.PaintWorkletRealmInfo = { - script.BaseRealmInfo, - type: "paint-worklet" -} - -script.AudioWorkletRealmInfo = { - script.BaseRealmInfo, - type: "audio-worklet" -} - -script.WorkletRealmInfo = { - script.BaseRealmInfo, - type: "worklet" -} - -script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" / - "worker" / "paint-worklet" / "audio-worklet" / "worklet" - -script.RemoteReference = ( - script.SharedReference / - script.RemoteObjectReference -) - -script.SharedReference = { - sharedId: script.SharedId - ? handle: script.Handle, - Extensible -} - -script.RemoteObjectReference = { - handle: script.Handle, - ? sharedId: script.SharedId - Extensible -} - -script.RemoteValue = ( - script.PrimitiveProtocolValue / - script.SymbolRemoteValue / - script.ArrayRemoteValue / - script.ObjectRemoteValue / - script.FunctionRemoteValue / - script.RegExpRemoteValue / - script.DateRemoteValue / - script.MapRemoteValue / - script.SetRemoteValue / - script.WeakMapRemoteValue / - script.WeakSetRemoteValue / - script.GeneratorRemoteValue / - script.ErrorRemoteValue / - script.ProxyRemoteValue / - script.PromiseRemoteValue / - script.TypedArrayRemoteValue / - script.ArrayBufferRemoteValue / - script.NodeListRemoteValue / - script.HTMLCollectionRemoteValue / - script.NodeRemoteValue / - script.WindowProxyRemoteValue -) - -script.ListRemoteValue = [*script.RemoteValue]; - -script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]]; - -script.SymbolRemoteValue = { - type: "symbol", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayRemoteValue = { - type: "array", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.ObjectRemoteValue = { - type: "object", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.FunctionRemoteValue = { - type: "function", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.RegExpRemoteValue = { - script.RegExpLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.DateRemoteValue = { - script.DateLocalValue, - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.MapRemoteValue = { - type: "map", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.MappingRemoteValue, -} - -script.SetRemoteValue = { - type: "set", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue -} - -script.WeakMapRemoteValue = { - type: "weakmap", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.WeakSetRemoteValue = { - type: "weakset", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.GeneratorRemoteValue = { - type: "generator", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ErrorRemoteValue = { - type: "error", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ProxyRemoteValue = { - type: "proxy", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.PromiseRemoteValue = { - type: "promise", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.TypedArrayRemoteValue = { - type: "typedarray", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.ArrayBufferRemoteValue = { - type: "arraybuffer", - ? handle: script.Handle, - ? internalId: script.InternalId, -} - -script.NodeListRemoteValue = { - type: "nodelist", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.HTMLCollectionRemoteValue = { - type: "htmlcollection", - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.ListRemoteValue, -} - -script.NodeRemoteValue = { - type: "node", - ? sharedId: script.SharedId, - ? handle: script.Handle, - ? internalId: script.InternalId, - ? value: script.NodeProperties, -} - -script.NodeProperties = { - nodeType: js-uint, - childNodeCount: js-uint, - ? attributes: {*text => text}, - ? children: [*script.NodeRemoteValue], - ? localName: text, - ? mode: "open" / "closed", - ? namespaceURI: text, - ? nodeValue: text, - ? shadowRoot: script.NodeRemoteValue / null, -} - -script.WindowProxyRemoteValue = { - type: "window", - value: script.WindowProxyProperties, - ? handle: script.Handle, - ? internalId: script.InternalId -} - -script.WindowProxyProperties = { - context: browsingContext.BrowsingContext -} - -script.ResultOwnership = "root" / "none" - -script.SerializationOptions = { - ? maxDomDepth: (js-uint / null) .default 0, - ? maxObjectDepth: (js-uint / null) .default null, - ? includeShadowTree: ("none" / "open" / "all") .default "none", -} - -script.SharedId = text; - -script.StackFrame = { - columnNumber: js-uint, - functionName: text, - lineNumber: js-uint, - url: text, -} - -script.StackTrace = { - callFrames: [*script.StackFrame], -} - -script.Source = { - realm: script.Realm, - ? context: browsingContext.BrowsingContext -} - -script.RealmTarget = { - realm: script.Realm -} - -script.ContextTarget = { - context: browsingContext.BrowsingContext, - ? sandbox: text -} - -script.Target = ( - script.ContextTarget / - script.RealmTarget -) - -script.AddPreloadScript = ( - method: "script.addPreloadScript", - params: script.AddPreloadScriptParameters -) - -script.AddPreloadScriptParameters = { - functionDeclaration: text, - ? arguments: [*script.ChannelValue], - ? contexts: [+browsingContext.BrowsingContext], - ? userContexts: [+browser.UserContext], - ? sandbox: text -} - -script.AddPreloadScriptResult = { - script: script.PreloadScript -} - -script.Disown = ( - method: "script.disown", - params: script.DisownParameters -) - -script.DisownParameters = { - handles: [*script.Handle] - target: script.Target; -} - -script.CallFunction = ( - method: "script.callFunction", - params: script.CallFunctionParameters -) - -script.CallFunctionParameters = { - functionDeclaration: text, - awaitPromise: bool, - target: script.Target, - ? arguments: [*script.LocalValue], - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? this: script.LocalValue, - ? userActivation: bool .default false, -} - -script.Evaluate = ( - method: "script.evaluate", - params: script.EvaluateParameters -) - -script.EvaluateParameters = { - expression: text, - target: script.Target, - awaitPromise: bool, - ? resultOwnership: script.ResultOwnership, - ? serializationOptions: script.SerializationOptions, - ? userActivation: bool .default false, -} - -script.GetRealms = ( - method: "script.getRealms", - params: script.GetRealmsParameters -) - -script.GetRealmsParameters = { - ? context: browsingContext.BrowsingContext, - ? type: script.RealmType, -} - -script.GetRealmsResult = { - realms: [*script.RealmInfo] -} - -script.RemovePreloadScript = ( - method: "script.removePreloadScript", - params: script.RemovePreloadScriptParameters -) - -script.RemovePreloadScriptParameters = { - script: script.PreloadScript -} - -script.Message = ( - method: "script.message", - params: script.MessageParameters - ) - -script.MessageParameters = { - channel: script.Channel, - data: script.RemoteValue, - source: script.Source, -} - -script.RealmCreated = ( - method: "script.realmCreated", - params: script.RealmInfo -) - -script.RealmDestroyed = ( - method: "script.realmDestroyed", - params: script.RealmDestroyedParameters -) - -script.RealmDestroyedParameters = { - realm: script.Realm -} - -StorageCommand = ( - storage.DeleteCookies // - storage.GetCookies // - storage.SetCookie -) - -StorageResult = ( - storage.DeleteCookiesResult / - storage.GetCookiesResult / - storage.SetCookieResult -) - -storage.PartitionKey = { - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.GetCookies = ( - method: "storage.getCookies", - params: storage.GetCookiesParameters -) - -storage.CookieFilter = { - ? name: text, - ? value: network.BytesValue, - ? domain: text, - ? path: text, - ? size: js-uint, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.BrowsingContextPartitionDescriptor = { - type: "context", - context: browsingContext.BrowsingContext -} - -storage.StorageKeyPartitionDescriptor = { - type: "storageKey", - ? userContext: text, - ? sourceOrigin: text, - Extensible, -} - -storage.PartitionDescriptor = ( - storage.BrowsingContextPartitionDescriptor / - storage.StorageKeyPartitionDescriptor -) - -storage.GetCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.GetCookiesResult = { - cookies: [*network.Cookie], - partitionKey: storage.PartitionKey, -} - -storage.SetCookie = ( - method: "storage.setCookie", - params: storage.SetCookieParameters, -) - -storage.PartialCookie = { - name: text, - value: network.BytesValue, - domain: text, - ? path: text, - ? httpOnly: bool, - ? secure: bool, - ? sameSite: network.SameSite, - ? expiry: js-uint, - Extensible, -} - -storage.SetCookieParameters = { - cookie: storage.PartialCookie, - ? partition: storage.PartitionDescriptor, -} - -storage.SetCookieResult = { - partitionKey: storage.PartitionKey -} - -storage.DeleteCookies = ( - method: "storage.deleteCookies", - params: storage.DeleteCookiesParameters, -) - -storage.DeleteCookiesParameters = { - ? filter: storage.CookieFilter, - ? partition: storage.PartitionDescriptor, -} - -storage.DeleteCookiesResult = { - partitionKey: storage.PartitionKey -} - -LogEvent = ( - log.EntryAdded -) - -log.Level = "debug" / "info" / "warn" / "error" - -log.Entry = ( - log.GenericLogEntry / - log.ConsoleLogEntry / - log.JavascriptLogEntry -) - -log.BaseLogEntry = ( - level: log.Level, - source: script.Source, - text: text / null, - timestamp: js-uint, - ? stackTrace: script.StackTrace, -) - -log.GenericLogEntry = { - log.BaseLogEntry, - type: text, -} - -log.ConsoleLogEntry = { - log.BaseLogEntry, - type: "console", - method: text, - args: [*script.RemoteValue], -} - -log.JavascriptLogEntry = { - log.BaseLogEntry, - type: "javascript", -} - -log.EntryAdded = ( - method: "log.entryAdded", - params: log.Entry, -) - -InputCommand = ( - input.PerformActions // - input.ReleaseActions // - input.SetFiles -) - -InputEvent = ( - input.FileDialogOpened -) - -input.ElementOrigin = { - type: "element", - element: script.SharedReference -} - -input.PerformActions = ( - method: "input.performActions", - params: input.PerformActionsParameters -) - -input.PerformActionsParameters = { - context: browsingContext.BrowsingContext, - actions: [*input.SourceActions] -} - -input.SourceActions = ( - input.NoneSourceActions / - input.KeySourceActions / - input.PointerSourceActions / - input.WheelSourceActions -) - -input.NoneSourceActions = { - type: "none", - id: text, - actions: [*input.NoneSourceAction] -} - -input.NoneSourceAction = input.PauseAction - -input.KeySourceActions = { - type: "key", - id: text, - actions: [*input.KeySourceAction] -} - -input.KeySourceAction = ( - input.PauseAction / - input.KeyDownAction / - input.KeyUpAction -) - -input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] -} - -input.PointerType = "mouse" / "pen" / "touch" - -input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" -} - -input.PointerSourceAction = ( - input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction -) - -input.WheelSourceActions = { - type: "wheel", - id: text, - actions: [*input.WheelSourceAction] -} - -input.WheelSourceAction = ( - input.PauseAction / - input.WheelScrollAction -) - -input.PauseAction = { - type: "pause", - ? duration: js-uint -} - -input.KeyDownAction = { - type: "keyDown", - value: text -} - -input.KeyUpAction = { - type: "keyUp", - value: text -} - -input.PointerUpAction = { - type: "pointerUp", - button: js-uint, -} - -input.PointerDownAction = { - type: "pointerDown", - button: js-uint, - input.PointerCommonProperties -} - -input.PointerMoveAction = { - type: "pointerMove", - x: float, - y: float, - ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties -} - -input.WheelScrollAction = { - type: "scroll", - x: js-int, - y: js-int, - deltaX: js-int, - deltaY: js-int, - ? duration: js-uint, - ? origin: input.Origin .default "viewport", -} - -input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, -) - -input.Origin = "viewport" / "pointer" / input.ElementOrigin - -input.ReleaseActions = ( - method: "input.releaseActions", - params: input.ReleaseActionsParameters -) - -input.ReleaseActionsParameters = { - context: browsingContext.BrowsingContext, -} - -input.SetFiles = ( - method: "input.setFiles", - params: input.SetFilesParameters -) - -input.SetFilesParameters = { - context: browsingContext.BrowsingContext, - element: script.SharedReference, - files: [*text] -} - -input.FileDialogOpened = ( - method: "input.fileDialogOpened", - params: input.FileDialogInfo -) - -input.FileDialogInfo = { - context: browsingContext.BrowsingContext, - ? element: script.SharedReference, - multiple: bool, -} - -WebExtensionCommand = ( - webExtension.Install // - webExtension.Uninstall -) - -WebExtensionResult = ( - webExtension.InstallResult -) - -webExtension.Extension = text - -webExtension.Install = ( - method: "webExtension.install", - params: webExtension.InstallParameters -) - -webExtension.InstallParameters = { - extensionData: webExtension.ExtensionData, -} - -webExtension.ExtensionData = ( - webExtension.ExtensionArchivePath / - webExtension.ExtensionBase64Encoded / - webExtension.ExtensionPath -) - -webExtension.ExtensionPath = { - type: "path", - path: text, -} - -webExtension.ExtensionArchivePath = { - type: "archivePath", - path: text, -} - -webExtension.ExtensionBase64Encoded = { - type: "base64", - value: text, -} - -webExtension.InstallResult = { - extension: webExtension.Extension -} - -webExtension.Uninstall = ( - method: "webExtension.uninstall", - params: webExtension.UninstallParameters -) - -webExtension.UninstallParameters = { - extension: webExtension.Extension, -}