template <>

class WireWeakSyncClientImpl

Defined at line 11201 of file fidling/gen/sdk/fidl/fuchsia.web/fuchsia.web/cpp/fidl/fuchsia.web/cpp/wire_messaging.h

Public Methods

::fidl::WireResult< ::fuchsia_web::Frame::ExecuteJavaScript> ExecuteJavaScript (::fidl::VectorView< ::fidl::StringView> origins, ::fuchsia_mem::wire::Buffer && script)

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.

Allocates 48 bytes of response buffer on the stack. Request is heap-allocated.

::fidl::WireResult< ::fuchsia_web::Frame::ExecuteJavaScriptNoResult> ExecuteJavaScriptNoResult (::fidl::VectorView< ::fidl::StringView> origins, ::fuchsia_mem::wire::Buffer && script)

Variant of [`Frame.ExecuteJavaScript`] which executes the supplied script without returning

a result.

Allocates 32 bytes of response buffer on the stack. Request is heap-allocated.

::fidl::WireResult< ::fuchsia_web::Frame::AddBeforeLoadJavaScript> AddBeforeLoadJavaScript (uint64_t id, ::fidl::VectorView< ::fidl::StringView> origins, ::fuchsia_mem::wire::Buffer && script)

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.

Allocates 32 bytes of response buffer on the stack. Request is heap-allocated.

::fidl::WireResult< ::fuchsia_web::Frame::PostMessage> PostMessage (::fidl::StringView target_origin, ::fuchsia_web::wire::WebMessage message)

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](https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages)

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`.

Allocates 32 bytes of response buffer on the stack. Request is heap-allocated.

::fidl::WireResult< ::fuchsia_web::Frame::SetUrlRequestRewriteRules> SetUrlRequestRewriteRules (::fidl::VectorView< ::fuchsia_web::wire::UrlRequestRewriteRule> rules)

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`.

Allocates 16 bytes of response buffer on the stack. Request is heap-allocated.

::fidl::WireResult< ::fuchsia_web::Frame::GetPrivateMemorySize> 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.

Allocates 40 bytes of message buffer on the stack. No heap allocation necessary.