fuchsia.web

Added: 7

PROTOCOLS

Context

Defined in fuchsia.web/context.fidl

Manages browsing state (e.g. LocalStorage, cookies, etc) associated with a set of Frame.

CreateFrame

Creates a new Frame under this Context. Destruction of a Context triggers the destruction of all of its associated Frame. Frame can be transferred to another component but cannot be shared across multiple components.

  • frame: An interface request that will be bound to the created Frame.

Request

NameType
frame server_end<Frame>

CreateFrameWithParams

Similar to Context.CreateFrame, with extra parameters.

  • params: The configuration used to create the Frame. This method will fail with ZX_ERR_INVALID_ARGS if the table is not clonable.
  • frame: An interface request that will be bound to the created Frame.

Request

NameType
params CreateFrameParams
frame server_end<Frame>

GetCookieManager

Used to observe cookies for sites hosted under this Context.

Request

NameType
manager server_end<CookieManager>

GetRemoteDebuggingPort

Waits until debugging is available on one or more Frames, and returns the DevTools port number. Multiple calls may be queued to received the port number.

If an error occurred, the ContextError will be set to this value:

  • REMOTE_DEBUGGING_PORT_NOT_OPENED: remote_debugging_port was not set in CreateContextParams or the remote debugging service failed to start.

Request

<EMPTY>

Response

NameType
payload Context_GetRemoteDebuggingPort_Result

ContextProvider

Defined in fuchsia.web/context.fidl

The top-level service interface which allows for the creation of Context resources.

Create

Creates a new browser Context whose state is wholly independent and isolated from other Context(Contexts).

  • params: The configuration used to create the Context.
  • context: An interface request which will receive a bound Context service.

Request

NameType
params CreateContextParams
context server_end<Context>

CookieManager

Defined in fuchsia.web/cookie.fidl

Provides methods for monitoring and accessing browser cookie state.

GetCookieList

Returns a list of Cookies, optionally limited to those matching url, and optionally name. cookies iterates over the matching cookies, including their values.

Request

NameType
url Url
name CookieName
cookies server_end<CookiesIterator>

ObserveCookieChanges

Observe changes to all cookies named name that would be sent in a request to url.

If neither url nor name are set then all cookies are observed. If only url is set then all cookies for that URL are observed. If both are set then only cookies matching both fields are observed.

changes iterates over a stream of cookie changes. Additions or updates are expressed as complete cookies, while deletions are expressed as cookies with no value set.

Request

NameType
url Url
name CookieName
changes server_end<CookiesIterator>

CookiesIterator

Defined in fuchsia.web/cookie.fidl

Used to iterator over a set of cookies, or a stream of changes to cookies.

GetNext

Fetches the next batch of cookies, or of changes to cookies. RFC6265 does not specify an upper-bound on the number of cookies which may be stored.

Request

<EMPTY>

Response

NameType
changed_cookies vector<Cookie>

Debug

Defined in fuchsia.web/debug.fidl

The debug service which allows to enable the DevTools service on Contexts.

EnableDevTools

Enables the DevTools service on every subsequent Context creation and delivers subsequent DevTools events to the supplied listener. The callback indicates when the WebEngine is in a debuggable state. Events will be sent to every listener registered with this method.

Because DevTools debugging is exposed using TCP as its transport, only Contexts created with access to network capabilities will report themselves as available for debugging.

Request

NameType
listener DevToolsListener

Response

<EMPTY>

DevToolsListener

Defined in fuchsia.web/debug.fidl

Interface used to observe DevTools service availability events.

OnContextDevToolsAvailable

Called when the DevTools service is available on a new Context.

  • listener: Channel over which DevTools events for the new Context will be delivered. This channel will disconnect when the Context is destroyed.

Request

NameType
listener server_end<DevToolsPerContextListener>

DevToolsPerContextListener

Defined in fuchsia.web/debug.fidl

Interface supplied by the debugging component to observe the DevTools service opening event.

OnHttpPortOpen

Called when the DevTools service starts accepting TCP connections on port. port will remain open until the Context is destroyed.

  • port: The port used by the service.

Request

NameType
port uint16

Frame

Defined in fuchsia.web/frame.fidl

AddBeforeLoadJavaScript

Executes a UTF-8 encoded script for every subsequent page load where the Frame's URL has an origin reflected in origins. The script is executed early, prior to the execution of the document's scripts.

Scripts are identified by a client-managed identifier id. Any script previously injected using the same id will be replaced.

The order in which multiple bindings are executed is the same as the order in which the bindings were added. If a script is added which clobbers an existing script of the same id, the previous script's precedence in the injection order will be preserved.

At least one origins entry must be specified. If a wildcard "*" is specified in origins, then the script will be evaluated unconditionally.

If an error occurred, the FrameError will be set to one of these values:

  • BUFFER_NOT_UTF8: script is not UTF-8 encoded.
  • INVALID_ORIGIN: origins is an empty vector.

Request

NameType
id uint64
origins vector<string>
script fuchsia.mem/Buffer

Response

NameType
payload Frame_AddBeforeLoadJavaScript_Result

Close

Request graceful or immediate teardown of the Frame content and notification of completion via Frame epitaph.

Graceful teardown allows unload and cleanup tasks in the implementation and web content (e.g., unload event handlers) to run for up to the specified period of time. Immediate teardown only runs the minimum cleanup tasks in the implementation and does not allow web content to run event handlers.

  • If timeout is zero, an immediate teardown is initiated. The channel will close with ZX_OK. This is equivalent to the caller closing the Frame channel.

  • If timeout is non-zero, a graceful teardown is initiated. The channel will close with ZX_OK if the Frame closes within the specified timeout and with ZX_ERR_TIMED_OUT otherwise.

  • If timeout is not specified, a reasonable implementation-specific timeout is applied.

Subsequent calls to Close() will override any previously specified Close() timeout.

Added: 10

Request

NameType
payload FrameCloseRequest

ConfigureInputTypes

Enables or disables the processing of the specified types of user inputs. allow specifies whether to enable or disable the specified types. All input types are enabled by default.

Request

NameType
types InputTypes
allow AllowInputState

CreateView

Creates a new view using the specified view_token. Caller should pass the other end of the token to fuchsia.ui.gfx/ViewHolderArgs to attach the new view to a view tree.

See the description of CreateContextParams.service_directory for additional services that must be present when using this method.

Deprecated: 13

Request

NameType
view_token fuchsia.ui.views/ViewToken

CreateView2

Creates a new Flatland view using the specified view_creation_token defined under args. Caller should pass the other end of the token to fuchsia.ui.composition/Flatland.CreateViewport to attach the new Flatland view to its graph.

Request

NameType
args CreateView2Args

CreateViewWithViewRef

Creates a new view using the specified view_token. Caller should pass the other end of the token to fuchsia.ui.gfx/ViewHolderArgs to attach the new view to a view tree. view_ref can be cloned before passing it to this method, which will allow clients to track the view.

view_ref_control must not have the ZX_RIGHT_DUPLICATE set, or view creation will fail and view_token will be closed.

See the description of CreateContextParams.service_directory for additional services that must be present when using this method.

Deprecated: 13

Request

NameType
view_token fuchsia.ui.views/ViewToken
view_ref_control fuchsia.ui.views/ViewRefControl
view_ref fuchsia.ui.views/ViewRef

DisableHeadlessRendering

Stops headless rendering of the Frame.

May only be used on a Context created with ContextFeatureFlags.HEADLESS.

Request

<EMPTY>

EnableHeadlessRendering

Enables headless rendering of the Frame.

This is used when content depends on layout and/or animation events firing normally. May only be used on a Context created with ContextFeatureFlags.HEADLESS.

Request

<EMPTY>

ExecuteJavaScript

Executes a UTF-8 encoded script in the Frame if the Frame's URL has an origin which matches entries in origins.

At least one origins entry must be specified. If a wildcard "*" is specified in origins, then the script will be evaluated unconditionally.

Returns the result of executing script, as a JSON-encoded string.

Note that scripts share the same execution context as the document, meaning that document may modify variables, classes, or objects set by the script in arbitrary or unpredictable ways.

If an error occurred, the FrameError will be set to one of these values:

  • BUFFER_NOT_UTF8: script is not UTF-8 encoded.
  • INVALID_ORIGIN: The Frame's current URL does not match any of the values in origins or origins is an empty vector.

Request

NameType
origins vector<string>
script fuchsia.mem/Buffer

Response

NameType
payload Frame_ExecuteJavaScript_Result

ExecuteJavaScriptNoResult

Variant of Frame.ExecuteJavaScript which executes the supplied script without returning a result.

Request

NameType
origins vector<string>
script fuchsia.mem/Buffer

Response

NameType
payload Frame_ExecuteJavaScriptNoResult_Result

ForceContentDimensions

Overrides the dimensions reported to web content. The devicePixelRatio reported to web content will be adjusted in response to changes in the pixel size of the View, rather than changing the size reported to the content. Call with null web_dips to remove any prior forced content dimensions.

Deprecated: 13

Request

NameType
web_dips fuchsia.ui.gfx/vec2?

GetMediaPlayer

Returns a fuchsia.media.sessions2/Player interface through which media (i.e. video/audio) playback in the frame may be observed, and/or controlled. Only one fuchsia.media.sessions2/Player may be active at a time, for each Frame.

Request

NameType
player server_end<fuchsia.media.sessions2/Player>

GetNavigationController

Returns an interface through which the Frame may be navigated to a desired URL, reloaded, etc.

Request

NameType
controller server_end<NavigationController>

GetPrivateMemorySize

Returns the amount of private (non-shared) physical memory used by the Frame's main document. The returned size might not reflect the memory usage of embedded iframes.

Request

<EMPTY>

Response

NameType
size_bytes uint64

PostMessage

Posts a message to the frame's onMessage handler.

target_origin restricts message delivery to the specified origin. If target_origin is "*", then the message will be sent to the document regardless of its origin. See the HTML spec section 9.4.3 for more details on how the target origin policy is applied.

If an error occurred, the FrameError will be set to one of these values:

  • INTERNAL_ERROR: The WebEngine failed to create a message pipe.
  • BUFFER_NOT_UTF8: The script in message's data property is not UTF-8 encoded.
  • INVALID_ORIGIN: origins is an empty vector.
  • NO_DATA_IN_MESSAGE: The data property is missing in message.

Request

NameType
target_origin Url
message WebMessage

Response

NameType
payload Frame_PostMessage_Result

RemoveBeforeLoadJavaScript

Removes a previously added JavaScript snippet identified by id. This is a no-op if there is no JavaScript snippet identified by id.

Request

NameType
id uint64

ResetContentAreaSettings

Reset the Frame's ContentAreaSettings to default values.

Request

<EMPTY>

SetBlockMediaLoading

Sets whether to block all HTMLMediaElements in the frame from fetching and loading media resources.

May be used, for example, to prevent loading media in frames that are not visible.

While media loading is blocked, elements with autoplay set to true will not start playback. The promises returned by calls to play() will remain unresolved until loading is unblocked by a call to this method.

When media loading is unblocked, elements will begin fetching, resource, loading, and playing as appropriate.

Any elements that have begun fetching or loading media resources for the current source before media loading was blocked will continue to fetch, load, and start playback as appropriate. This includes calls to play() even after media loading is blocked.

Request

NameType
blocked bool

SetConsoleLogSink

Specifies where to emit console log output to. By default log output will be routed to a fuchsia.logger/LogSink obtained via the fuchsia.web/Context's service directory.

Request

NameType
sink fuchsia.logger/LogSink?

SetContentAreaSettings

Sets various settings for how web content should be run in the Frame. May be called at any time, including after the URL has loaded. Each call changes only the specified fields, overwriting any prior value.

This method will fail with ZX_ERR_NOT_SUPPORTED if any value in ContentAreaSettings is not supported by the Frame.

Request

NameType
settings ContentAreaSettings

SetJavaScriptLogLevel

If set to a value other than ConsoleLogLevel.NONE, allows web content to log messages to the fuchsia.logger/LogSink configured for this Frame, via the console object (e.g. using debug(), log(), info(), warn() and error()). The default value is ConsoleLogLevel.NONE.

As the system log may be persisted, it is recommended that ConsoleLogLevel.NONE be used in Incognito and other private browsing modes.

Log lines are written to the fuchsia.logger/LogsSink configured for this fuchsia.web/Frame, with severities mapped as follows:

Request

NameType
level ConsoleLogLevel

SetMediaSettings

Sets fuchsia.media/FrameMediaSettings for the frame. The specified parameters are applied to audio streams that started after this message is processed. Should be called before the Frame is navigated to content in order to ensure that the settings applied to all media streams. Due to request pipelining, this means doing so before calling Frame.GetNavigationController() and NavigationController.LoadUrl().

Request

NameType
settings FrameMediaSettings

SetNavigationEventListener

Sets the listener for handling page navigation events.

  • listener: The observer to use. Unregisters any existing listener if null.

Request

NameType
listener NavigationEventListener?

SetNavigationEventListener2

Sets the listener for handling page navigation events. The listener will receive the current navigation state immediately. After that, it's notified whenever the state changes.

  • listener: The observer to use. Unregisters any existing listener if null.
  • flags: Flags for optional features that should be enabled for the listener.

Request

NameType
listener NavigationEventListener?
flags NavigationEventListenerFlags

SetNavigationPolicyProvider

Sets the navigation policy provider for the Frame. When set, the Frame sends NavigationPolicyProvider.EvaluateRequestedNavigation when processing navigation requests. params defines when the message is sent. After sending the EvaluateRequestedNavigation message, the Frame blocks the corresponding navigation until it receives a response.

Should be called before GetNavigationController to ensure that it is applied to all navigations including the first NavigationController.LoadURL request.

Request

NameType
params NavigationPolicyProviderParams
provider NavigationPolicyProvider

SetPermissionState

Sets the permission state for the specified permission and web_origin. By default, all permissions are denied.

Request

NameType
permission PermissionDescriptor
web_origin Url
state PermissionState

SetPopupFrameCreationListener

Sets the listener for handling popup frame opened by web content. If no listener is present, then any new popup frame will be blocked.

  • listener: The listener to use. Unregisters any existing listener if null.

Request

NameType
listener PopupFrameCreationListener?

SetUrlRequestRewriteRules

Supplies a set of UrlRequestRewriteRule to apply on every subsequent URL request.

  • rules are cumulative and applied in order.
  • rules are only applied on the first URL request in a redirect chain.
  • rules will be validated before being applied. If rules are invalid, the Frame will be closed with ERR_INVALID_ARGS.
  • Frame.SetUrlRequestRewriteRules must not be called again until its acknowledgement callback has been processed. If this happens, the Frame will be closed with ERR_BAD_STATE.

Request

NameType
rules vector<UrlRequestRewriteRule>[4096]

Response

<EMPTY>

FrameHost

Defined in fuchsia.web/context.fidl

Used by Context clients to delegate Frame hosting capabilities to selected peers.

CreateFrameWithParams

Behaves identically to Context.CreateFrameWithParams.

Request

NameType
params CreateFrameParams
frame server_end<Frame>

MessagePort

Defined in fuchsia.web/frame.fidl

Represents one end of an HTML5 MessageChannel. Can be used to send and exchange Messages with the peered MessagePort in the Frame's script context. The port is destroyed when either end of the MessagePort channel is torn down.

PostMessage

Sends a WebMessage to the peer. These are processed in order, one at a time. It is not necessary for the caller to wait for the completion callback before calling MessagePort.PostMessage again.

If an error occurred, the FrameError will be set to one of these value:

  • BUFFER_NOT_UTF8: The script in message's data property is not UTF-8 encoded.
  • NO_DATA_IN_MESSAGE: The data property is missing in message.

Request

NameType
message WebMessage

Response

NameType
payload MessagePort_PostMessage_Result

ReceiveMessage

Asynchronously reads the next message from the channel. The client should invoke the callback when it is ready to process another message. Unreceived messages are buffered on the sender's side and bounded by its available resources.

Request

<EMPTY>

Response

NameType
message WebMessage

Defined in fuchsia.web/navigation.fidl

Provides methods for controlling and querying the navigation state of a Frame.

Tells the Frame to navigate to the previous page in its history, if any.

<EMPTY>

Tells the Frame to navigate to the next page in its history, if any.

<EMPTY>

Tells the Frame to navigate to a url.

  • url: The address to navigate to.
  • params: Additional parameters that affect how the resource will be loaded (e.g. cookies, HTTP headers, etc.)

If an error occurred, the NavigationControllerError will be set to one of these values:

  • INVALID_URL: The url parameter is invalid.
  • INVALID_HEADER: At least one of the headers in LoadUrlParams.headers is invalid.
NameType
url Url
params LoadUrlParams
NameType
payload NavigationController_LoadUrl_Result

Tells the Frame to reload the current page.

NameType
type ReloadType

Tells the Frame to stop the current navigation if a navigation is ongoing.

<EMPTY>

Defined in fuchsia.web/navigation.fidl

Interface supplied by the embedder for receiving notifications about navigation events in a Frame.

Called immediately after Frame.SetNavigationEventListener and every time user-visible navigation state has changed. In the first call, change contains the current navigation state (empty before the first navigation request). In every following call, change will have values set for all fields that have changed at any time since the previous notification. This means that some fields may have the same value as was previously reported, for example, if they changed to some other value and back again. If a field is unset, then its value has not changed at any time since the previous notification.

Implementer must call the acknowledgement callback to receive new navigation events.

NameType
change NavigationState

<EMPTY>

Defined in fuchsia.web/navigation.fidl

Called when the Frame is processing a navigation request in one of the phase(s) specified in NavigationPolicyProviderParams. Navigation is paused until the result is received. The returned NavigationDecision defines how the navigation should proceed.

NameType
requested_navigation RequestedNavigation
NameType
decision NavigationDecision

PopupFrameCreationListener

Defined in fuchsia.web/frame.fidl

OnPopupFrameCreated

Called when a Frame has created a new popup frame. Information about the popup frame, and how it was created, is provided via info. Additional popup frames are delivered after the acknowledgement callback is invoked.

Request

NameType
frame Frame
info PopupFrameCreationInfo

Response

<EMPTY>

STRUCTS

Context_GetRemoteDebuggingPort_Response

Defined in fuchsia.web/context.fidl

FieldTypeDescriptionDefault
port uint16 No default

Frame_AddBeforeLoadJavaScript_Response

Defined in fuchsia.web/frame.fidl

<EMPTY>

Frame_ExecuteJavaScriptNoResult_Response

Defined in fuchsia.web/frame.fidl

<EMPTY>

Frame_ExecuteJavaScript_Response resource

Defined in fuchsia.web/frame.fidl

FieldTypeDescriptionDefault
result fuchsia.mem/Buffer No default

Frame_PostMessage_Response

Defined in fuchsia.web/frame.fidl

<EMPTY>

MessagePort_PostMessage_Response

Defined in fuchsia.web/frame.fidl

<EMPTY>

Defined in fuchsia.web/navigation.fidl

<EMPTY>

NoArgumentsAction

Defined in fuchsia.web/navigation.fidl

Empty struct used in NavigationDecision for actions that don't hav any arguments.

<EMPTY>

ENUMS

AllowInputState strict

Type: int32

Defined in fuchsia.web/frame.fidl

Controls whether Frame.ConfigureInputTypes() should allow or deny processing of the specified InputTypes.

NameValueDescription
1
2

AutoplayPolicy strict

Type: int32

Defined in fuchsia.web/context.fidl

Specifies the policy for automatic (non user-initiated) playback of video and audio content.

NameValueDescription
1

All media is permitted to autoplay.

2

Allow autoplay when the document has received a user activation. This can be the result of user action or LoadUrlParams.was_user_activated being set.

ConsoleLogLevel strict

Type: int32

Defined in fuchsia.web/frame.fidl

NameValueDescription
100

No logging.

-1

Outputs messages from console.debug() and above levels.

0

Outputs messages from console.log(), console.info() and above levels.

1

Outputs messages from console.warn() and console.error().

2

Outputs messages from console.error().

ContextError strict

Type: int32

Defined in fuchsia.web/context.fidl

NameValueDescription
1

The remote debugging service was not opened.

FrameError strict

Type: int32

Defined in fuchsia.web/frame.fidl

Represents the return status of a Frame method.

NameValueDescription
1

An internal error occurred.

2

The provided buffer is not UTF-8 encoded.

3

The Frame's URL does not match any of the origins provided by the caller.

4

The required data property is missing from a WebMessage.

LoadUrlReason strict

Type: uint32

Defined in fuchsia.web/navigation.fidl

Characterizes the origin of a NavigationController.LoadUrl request.

NameValueDescription
1

Navigation was initiated by a user-provided URL.

Type: int32

Defined in fuchsia.web/navigation.fidl

Represents the return status of a NavigationController method.

NameValueDescription

PageType strict

Type: uint32

Defined in fuchsia.web/navigation.fidl

Characterizes the page type in a NavigationState.

NameValueDescription
0

Regular web page.

1

Error page.

PermissionState strict

Type: uint8

Defined in fuchsia.web/frame.fidl

A state for a web permission.

NameValueDescription
1

Permission is denied.

2

Permission is granted.

PermissionType strict

Type: uint16

Defined in fuchsia.web/frame.fidl

Identifies a type of permission that may be granted to a web origin.

NameValueDescription
1

Permission to access microphone(s).

2

Permission to access camera(s).

3

Permission to use device identifier(s) for EME.

4

Permission to use persistent storage.

ReloadType strict

Type: uint32

Defined in fuchsia.web/navigation.fidl

Characterizes the type of reload.

NameValueDescription
0

Reloads the current entry, bypassing the cache for the main resource.

1

Reloads the current entry, bypassing the cache entirely.

UrlRequestAction strict

Type: int32

Defined in fuchsia.web/url_request_rewrite_rules.fidl

NameValueDescription
1

Allow the request to be processed.

2

Block the request.

TABLES

ContentAreaSettings

Defined in fuchsia.web/frame.fidl

Settings for the web content in the Frame. Popup Frames created by the Frame will have their settings initialized to the Frame's current settings.

OrdinalFieldTypeDescription
hide_scrollbars bool

Specifies whether scrollbars are hidden for the Frame. If omitted, the default is false.

autoplay_policy AutoplayPolicy

Specifies the autoplay policy for the Frame. If omitted, the default policy is REQUIRE_USER_ACTIVATION.

theme fuchsia.settings/ThemeType

Specifies the color theme reported to web content via the prefers-color-scheme media query. Valid inputs are LIGHT, DARK, and DEFAULT. If omitted, the default is LIGHT theme. Specifying DEFAULT means using the system settings, and requires that the Context have the fuchsia.settings.Display service. If the service is not available, the Frame will disconnect with ZX_ERR_INVALID_ARGS.

page_scale float32

Sets scale factor (zoom level) that should be applied to web content rendered in this frame. Values above 1.0 make all web content (including text and images) larger, while values below 1.0 will make it smaller. In other words, values above 1.0 are used to zoom in and values below 1.0 zoom out. The overall ratio between physical pixel and CSS pixel is a product of the scale set with this method and the scale provided by Scenic (see fuchsia.ui.gfx.Metrics). That product is visible to the web content as window.devicePixelRatio. If omitted, the default is 1.0.

This setting does not have any effect on the size of the view on the screen and the resolution at which the view is rendered. Native (non-web) UI elements, such as default scroll bars and default mouse cursor, are not scaled. User may zoom the page further when pinch-zoom is enabled (see InputTypes.GESTURE_PINCH).

ContentDirectoryProvider resource

Defined in fuchsia.web/context.fidl

Defines a provider which hosts resources from a fuchsia.io/Directory. Content can GET resource files via the provider, but not enumerate directories. Resources can be accessed by their URLs: fuchsia-dir://<provider-name>/<path/to/resource>

By default the MIME types of files are determined automatically by "sniffing" the contents of the files. No content encoding will be declared, which browsers will interpret as meaning "text/plain".

Content type and encoding metadata may optionally be specified explicitly by metadata files, which reside alongside the file. Metadata is expressed in JSON files, named after the files they describe with a "._metadata" suffix.

For example, the file "index.html" would have the a metadata file called "index.html._metadata", with the following contents:

{
  "charset": "utf-8",
  "mime": "text/html"
}

OrdinalFieldTypeDescription
name string[255]

Name of the provider. Must be non-empty and composed solely of alphanumerics, dots, and dashes.

directory fuchsia.io/Directory

Directory containing the files served by this provider.

Defined in fuchsia.web/cookie.fidl

OrdinalFieldTypeDescription
id CookieId

A table with fields to identify a cookie.

value string

The cookie value. RFC6265 does not specify an upper limit on cookie size, but recommends that at least 4096 bytes are supported.

CookieId

Defined in fuchsia.web/cookie.fidl

OrdinalFieldTypeDescription
name CookieName

An RFC2616 "token" chosen by the site to identify the cookie.

domain string[255]

The RFC1034 "subdomain" to which this cookie is scoped. e.g. "example.com" allows access from all *.example.com sub-domains.

path string[65536]

The URL "path" prefix to which this cookie is scoped. e.g. "/" allows access from all paths.

CreateContextParams resource

Defined in fuchsia.web/context.fidl

Parameters specifying the configuration for a new Context.

OrdinalFieldTypeDescription
service_directory fuchsia.io/Directory

Service directory to be used by the context.

The following services must be present in the service directory:

The following services are recommended to be present in order to allow CPU scheduling profiles to be applied to threads to tune their performance, especially for media rendering.

The following services must be present in order to render web content in a Scenic view using Frame.CreateView, Frame.CreateViewWithViewRef or Frame.CreateView2]:

The following service must be present in order to collect diagnostic tracing data.

data_directory fuchsia.io/Directory

Handle to the directory that will contain the Context's persistent data. If it is left unset, then the created Context will be stateless, with all of its data discarded upon Context destruction.

If set, data_directory must not be shared with any other Context.

user_agent_product string[128]

Optional string describing the embedding product to append to the User-Agent string. See the specification for the HTTP User-Agent header. Requires that user_agent_version is also specified.

user_agent_version string[128]

Optional version for the embedding product to append to the User-Agent string.

Requires that user_agent_product is also specified.

remote_debugging_port uint16

Enables Frames to be created with remote debugging enabled using the DevTools protocol. If port is 0, then an ephemeral port will be used, which can be queried via the Context.GetRemoteDebuggingPort API.

Because remote debugging uses TCP, it is not valid to set a remote debugging port without having also set ContextFeatureFlags.NETWORK for the context.

content_directories vector<ContentDirectoryProvider>[100]

List of providers whose contents will be served by fuchsia-dir:// URLs.

features ContextFeatureFlags

Optional features that should be enabled for this context. Some features may also require additional services in service_directory.

playready_key_system string[128]

Enables PlayReady CDM for the Context using the specified string as a key system string. The string should be a reverse domain name, as required by EME API.

unsafely_treat_insecure_origins_as_secure vector<string>[100]

Treat given insecure origins as secure origins. For the definition of secure contexts, see Secure Contexts and origin trustworthiness.

Example value: {"http://a.com", "http://b.com"}.

cors_exempt_headers vector<vector<uint8>>

Specifies a set of header names for which Cross-Origin Resource Sharing (CORS) checks should not be enforced.

cdm_data_directory fuchsia.io/Directory

Specifies the storage to use to persistent content licensing related data (e.g. provisioning data, persistent session data). By default these data will be placed under the data_directory, if specified.

If neither data_directory nor cdm_data_directory are specified, then content licensing features requiring persistent storage (e.g. persistent licensing sessions) will not be available to the Context.

Note that not all content licensing systems support persistent sessions, regardless of whether persistent storage is provided.

cdm_data_quota_bytes uint64

Specifies a target maximum size for cdm_data_directory contents, in bytes. If the amount of persisted CDM data exceeds this threshold, then the Context will attempt to purge some data to meet the specified quota.

data_quota_bytes uint64

Specifies a target maximum size for data_directory contents, in bytes. The Context will attempt to limit browsing state (e.g. cookies, LocalStorage) to not exceed the specified size.

CreateFrameParams resource

Defined in fuchsia.web/context.fidl

Parameters specifying the configuration for a new Frame.

OrdinalFieldTypeDescription
enable_remote_debugging bool

Set to true to enable remote debugging. The Frame will be closed with ERR_INVALID_ARGS if remote_debugging_port was not set in CreateContextParams.

debug_name string

Set to give the Frame a name to help distinguish it in debug contexts , such as system log output. For example, the name may be added to messages from web content when they are logged to the system logger. The name does not affect user- or web-visible behavior. Popup Frames created by the Frame will have a name derived from the parent Frame's name.

RESERVED
explicit_sites_filter_error_page fuchsia.mem/Data

Enables automatic blocking of navigations to explicit sites, and specifies the error page content, in HTML, to be loaded in the Frame when a navigation is canceled by the filter. Applies to navigations in all frames within the Frame. When navigation of the main document is canceled, the Frame's NavigationState.PageType is ERROR. If set to an empty buffer, a default error message will be displayed. If set and such filtering is not supported, the Frame will disconnect with ZX_ERR_NOT_SUPPORTED.

CreateView2Args resource

Defined in fuchsia.web/frame.fidl

Args for Frame.CreateView2(), see above.

OrdinalFieldTypeDescription
view_creation_token fuchsia.ui.views/ViewCreationToken

Non-optional. This token is provided to attach the client's Flatland view to the parent's viewport.

Favicon resource

Defined in fuchsia.web/navigation.fidl

Used to represent a favicon for a page. An empty table (all fields are unset) is used to indicate that the page doesn't have a favicon.

OrdinalFieldTypeDescription
data fuchsia.mem/Buffer

The image content encoded as an RGBA bitmap with premultiplied alpha channel. The data is densely packed, so the stride is always 4 * width and the total size is 4 * width * height.

width uint32

The width of the image.

height uint32

The height of the image.

FrameCloseRequest

Defined in fuchsia.web/frame.fidl

OrdinalFieldTypeDescription
timeout zx/Duration

Optional.

FrameMediaSettings

Defined in fuchsia.web/frame.fidl

OrdinalFieldTypeDescription
renderer_usage fuchsia.media/AudioRenderUsage

The fuchsia.media/AudioRenderUsage to set for every fuchsia.media/AudioRenderer instance created by the Frame. If not set, the usage is COMMUNICATION for WebRTC streams and MEDIA for all other streams.

audio_consumer_session_id uint64

When set, enables usage of fuchsia.media/AudioConsumer for audio playback. In that case the specified value is passed to fuchsia.media/SessionAudioConsumerFactory.

LoadUrlParams resource

Defined in fuchsia.web/navigation.fidl

Additional parameters for modifying the behavior of NavigationController.LoadUrl.

OrdinalFieldTypeDescription
type LoadUrlReason

Provides a hint to the browser UI about how NavigationController.LoadUrl was triggered.

referrer_url Url

The URL that linked to the resource being requested.

was_user_activated bool

Should be set to true to propagate user activation to the frame. User activation implies that the user is interacting with the web frame. It enables some web features that are not available otherwise. For example, autoplay will work only when this flag is set to true.

headers vector<fuchsia.net.http/Header>

Custom HTTP headers. RFC7540 does not specify a limit on the number nor size of headers.

Defined in fuchsia.web/navigation.fidl

Used to specify which navigation events should be delegated to NavigationPolicyProvider.

OrdinalFieldTypeDescription

Defined in fuchsia.web/navigation.fidl

Contains information about the Frame's navigation state.

OrdinalFieldTypeDescription

PermissionDescriptor

Defined in fuchsia.web/frame.fidl

Describes a web permission. In the future, it may be extended with type-specific fields.

OrdinalFieldTypeDescription
type PermissionType

PopupFrameCreationInfo resource

Defined in fuchsia.web/frame.fidl

Specifies additional information about a newly created popup frame.

OrdinalFieldTypeDescription
initial_url Url

The URL to which the popup frame was initially navigated.

initiated_by_user bool

Set if the popup frame was created in response to UI interaction from the user (e.g. a link was clicked).

RequestedNavigation

Defined in fuchsia.web/navigation.fidl

OrdinalFieldTypeDescription
id NavigationId

Unique ID of the navigation.

phase NavigationPhase

Current navigation phase. Exactly one bit will be set.

is_main_frame bool

Whether the navigation is taking place in the main frame versus in a subframe.

is_same_document bool

Whether the navigation happened without changing the document.

5

is_http_post bool

Whether the navigation is a POST request.

url Url

The current target URL of the navigation. This may change for the same navigation after encountering a server redirect.

has_gesture bool

Whether the navigation was initiated by a user gesture.

was_server_redirect bool

Whether the navigation has encountered a server redirect or not.

UrlRequestRewriteAddHeaders

Defined in fuchsia.web/url_request_rewrite_rules.fidl

Adds headers to the URL request. If a header is already present in the original URL request, it will be overwritten.

OrdinalFieldTypeDescription
headers vector<fuchsia.net.http/Header>[4096]

UrlRequestRewriteAppendToQuery

Defined in fuchsia.web/url_request_rewrite_rules.fidl

Appends query to the URL's query. If the URL request already has a query, query will be appended to it, preceded by &. Otherwise, the URL's query will be set to query.

OrdinalFieldTypeDescription
query Url

UrlRequestRewriteRemoveHeader

Defined in fuchsia.web/url_request_rewrite_rules.fidl

If query_pattern is in the URL's query, removes header_name from the list of headers. If query_pattern is not set, removes header_name from the list of headers unconditionally.

OrdinalFieldTypeDescription
query_pattern Url
header_name fuchsia.net.http/HeaderName
Added: 12

UrlRequestRewriteReplaceUrl

Defined in fuchsia.web/url_request_rewrite_rules.fidl

If the URL in the URL request ends with url_ends_with, rewrites the URL to new_url.

OrdinalFieldTypeDescription
url_ends_with Url
new_url Url

UrlRequestRewriteRule

Defined in fuchsia.web/url_request_rewrite_rules.fidl

OrdinalFieldTypeDescription
hosts_filter vector<string>[4096]

Set of hosts to apply the rules to. If not set, the rule will apply to every request, independent of host.

schemes_filter vector<string>[4096]

Set of schemes to apply the rules to. If not set, the rule will apply to every request, independent of scheme.

rewrites vector<UrlRequestRewrite>[4096]

URL request rewrites to apply.

action UrlRequestAction

Specifies the action to take for requests matching the filter criteria. Requests are allowed by default.

UrlRequestRewriteSubstituteQueryPattern

Defined in fuchsia.web/url_request_rewrite_rules.fidl

If pattern is found in the URL's query, replaces it with substitution.

  • pattern and substitution must be set.
  • substitution must be a valid URL-query string.

OrdinalFieldTypeDescription
pattern Url
substitution Url

WebMessage resource

Defined in fuchsia.web/frame.fidl

OrdinalFieldTypeDescription
data fuchsia.mem/Buffer

The message payload, encoded as an UTF-8 string. This is a required property.

incoming_transfer vector<IncomingTransferable>

Optional list of objects transferred into the MessagePort from the FIDL client.

outgoing_transfer vector<OutgoingTransferable>

Optional list of objects transferred out of the MessagePort to the FIDL client.

UNIONS

Context_GetRemoteDebuggingPort_Result strict

Defined in fuchsia.web/context.fidl

OrdinalVariantTypeDescription
response Context_GetRemoteDebuggingPort_Response
err ContextError

Frame_AddBeforeLoadJavaScript_Result strict

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
response Frame_AddBeforeLoadJavaScript_Response
err FrameError

Frame_ExecuteJavaScriptNoResult_Result strict

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
response Frame_ExecuteJavaScriptNoResult_Response
err FrameError

Frame_ExecuteJavaScript_Result strict resource

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
response Frame_ExecuteJavaScript_Response
err FrameError

Frame_PostMessage_Result strict

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
response Frame_PostMessage_Response
err FrameError

IncomingTransferable flexible resource

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
message_port MessagePort

MessagePort_PostMessage_Result strict

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
response MessagePort_PostMessage_Response
err FrameError

Defined in fuchsia.web/navigation.fidl

OrdinalVariantTypeDescription

Defined in fuchsia.web/navigation.fidl

Navigation action that should be taken in response to a navigation request. Returned from NavigationPolicyProvider.EvaluateRequestedNavigation.

OrdinalVariantTypeDescription

OutgoingTransferable flexible resource

Defined in fuchsia.web/frame.fidl

OrdinalVariantTypeDescription
message_port server_end<MessagePort>

UrlRequestRewrite flexible

Defined in fuchsia.web/url_request_rewrite_rules.fidl

OrdinalVariantTypeDescription
add_headers UrlRequestRewriteAddHeaders

Adds a set of headers to a URL request.

remove_header UrlRequestRewriteRemoveHeader

Removes a header based on the presence of a pattern in the URL's query.

substitute_query_pattern UrlRequestRewriteSubstituteQueryPattern

Substitutes a pattern in the URL's query.

replace_url UrlRequestRewriteReplaceUrl

Replaces a URL if the original URL ends with a pattern.

append_to_query UrlRequestRewriteAppendToQuery

Appends to the URL's query.

BITS

ContextFeatureFlags strict

Type: uint64

Defined in fuchsia.web/context.fidl

Feature flags that allow augmenting Context behavior. Some features require additional services in the service directory provided during context initialization. See CreateContextParams.service_directory.

NameValueDescription
1

Enables network access. Requires the following services:

2

Enables audio input and output. Requires the following services:

4

Enables GPU-accelerated rendering of the web content. Requires the following services:

8

Enables hardware video decoding. ContextFeatureFlags.VULKAN must be enabled as well. Requires the following service:

16

Disables video codecs that cannot be decoded in hardware. Software decoders will only be used as fallbacks for hardware decoders, such as when insufficient resources are available. Requires ContextFeatureFlags.HARDWARE_VIDEO_DECODER.

32

Enables Widevine CDM modules for EME API. ContextFeatureFlags.VULKAN must be enabled as well. Requires fuchsia.media.drm/Widevine service. Requires that a cdm_data_directory be specified in CreateContextParams.

64

Allows embedders to render web content without graphical output or Scenic. Not compatible with ContextFeatureFlags.VULKAN.

128

Report telemetry data to the fuchsia.legacymetrics/MetricsRecorder.

256

Enables input events for keyboard keypresses. Requires fuchsia.ui.input3/Keyboard, from which the events are obtained.

512

Enables the use of onscreen virtual keyboards. The implementation will manage the state of the keyboard in response to input/focus events in web content. Requires the fuchsia.input.virtualkeyboard/ControllerCreator service and ContextFeatureFlags.KEYBOARD.

1024

Disables dynamic generation of machine-code from scripts (e.g. JavaScript) and other technologies (e.g. WebAssembly). This should typically result in scripts being executed by an interpreter, with associated loss in performance. Other technologies relying on dynamic code generation may be provided in a limited form where feasible, or unavailable if interpreting would render them unusable (as is likely the case for WebAssembly). fuchsia.kernel/VmexResource is not required if this option is set.

Added: 10

InputTypes strict

Type: uint64

Defined in fuchsia.web/frame.fidl

Identifies the types of input events which may be handled by a View.

NameValueDescription
1

Keyboard events.

2

Mouse button events, for any button.

4

Mouse scroll wheel events.

8

Mouse movement events.

16

Single tapping with one finger.

32

Pinching (for zooming).

64

Dragging a finger (for scrolling).

9223372036854775808

Matches all input types.

Type: uint64

Defined in fuchsia.web/frame.fidl

Flags clients can set when connecting a NavigationEventListener to indicates interest in optional features.

NameValueDescription

Type: uint32

Defined in fuchsia.web/navigation.fidl

Identifies a navigation phase.

NameValueDescription

CONSTANTS

NameValueTypeDescription
MAX_HEADERS_COUNT 4096 int32
MAX_HOST_LENGTH 255 int32
MAX_RULE_COUNT 4096 int32
MAX_SCHEME_AND_HOST_LENGTH 513 int32
MAX_URL_LENGTH 65536 int32
MAX_URL_SCHEME_NAME_LENGTH 255 int32

ALIASES

NameValueDescription
CookieName string[fidl/MAX]
Url string[MAX_URL_LENGTH]
UrlHostName string[MAX_HOST_LENGTH]
UrlSchemeAndHostName string[MAX_SCHEME_AND_HOST_LENGTH]
UrlSchemeName string[MAX_URL_SCHEME_NAME_LENGTH]