Skip to main content

OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy

Function OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy 

Source
pub unsafe extern "C" fn OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy(
    webTag: *const c_char,
    proxyObject: *const ArkWeb_ProxyObjectWithResult,
    permission: *const c_char,
)
Available on crate feature api-20 only.
Expand description

Registers a JavaScript object with callback methods, which may return values. This object will be injected into all frames of the current page, including all iframes, and will be accessible using the specified name in ArkWeb_ProxyObjectWithResult. The object will only be available in JavaScript after the next load or reload. These methods will be executed in the ArkWeb worker thread.

ยงArguments

  • webTag - Name of the web component.

  • proxyObject - JavaScript object to register, the object has callback functions with return value.

  • permission - Optional JSON string(default is null) for JSBridge permission control, allowing URL whitelist configuration at object-level and method-level.

Required System Capabilities: SystemCapability.Web.Webview.Core

Available since API-level: 20