Skip to main content

OH_ArkWeb_SetSchemeHandler

Function OH_ArkWeb_SetSchemeHandler 

Source
pub unsafe extern "C" fn OH_ArkWeb_SetSchemeHandler(
    scheme: *const c_char,
    webTag: *const c_char,
    schemeHandler: *mut ArkWeb_SchemeHandler,
) -> bool
Available on crate features api-11 and api-12 only.
Expand description

Set a ArkWeb_SchemeHandler for a specific scheme to intercept requests of that scheme type.

SchemeHandler should be set after the BrowserContext created.

Use WebviewController.initializeWebEngine to initialize the BrowserContext without create a ArkWeb.

§Arguments

  • scheme - Scheme that need to be intercepted.

  • webTag - The name of the web component.

  • schemeHandler - The SchemeHandler for the scheme. Only requests triggered from the specified web will be notified through this handler.

§Returns

  • Return true if set SchemeHandler for specific scheme successful, return false otherwise.

Required System Capabilities: SystemCapability.Web.Webview.Core

Available since API-level: 12