Hierarchy (View Summary)

Constructors

Properties

Accessors

Methods

Constructors

  • Returns WebViewExtBase

Properties

autoInjectJavaScriptBlocks: InjectExecuteJavaScript[]

List of code blocks to be executed after JS-files and CSS-files have been loaded.

autoInjectJSBridge: boolean

Auto Inject WebView JavaScript Bridge on load finished? Defaults to true.

autoInjectScriptFiles: LoadJavaScriptResource[]

List of js-files to be auto injected on load finished

autoInjectStyleSheetFiles: LoadStyleSheetResource[]

List of css-files to be auto injected on load finished

builtInZoomControls: boolean

Android: Is the built-in zoom mechanisms being used

cacheMode: "default" | "no_cache" | "cache_first" | "cache_only"
databaseStorage: boolean

Android: Enable/Disabled database storage API. Note: It affects all webviews in the process.

debugMode: boolean

Android: Enable/disable debug-mode

displayZoomControls: boolean

Android: displays on-screen zoom controls when using the built-in zoom mechanisms

domStorage: boolean

Android: Enable/Disabled DOM Storage API. E.g localStorage

injectBridge: boolean

Whether to install event bridge

injectPolyfills: boolean

Whether to install promise polyfill

nestedScrollView: boolean

ANDROID: should the webview support nested scroll. Default to true

Note: This can break some web views like maps pinch to zoom.

scrollBarIndicatorVisible: boolean
scrollBounce: boolean

iOS: Should the scrollView bounce? Defaults to true.

src: string

Gets or sets the url, local file path or HTML string.

supportPopups: boolean
supportXLocalScheme: boolean
supportZoom: boolean

Android: should the webview support zoom

tempSuspendSrcLoading: boolean

Prevent this.src loading changes from the webview's onLoadFinished-event

viewPortSize: ViewPortValue

Set viewport metadata for the webview. Set to false to disable.

Note: WkWebView defaults initial-scale=1.0.

webConsoleEnabled: boolean
isFetchSupported: boolean

Is Fetch API supported?

Note: Android's Native Fetch API needs to be replaced with the polyfill.

isPromiseSupported: boolean

Does this platform's WebView support promises?

supportXLocalScheme: boolean

Accessors

  • get canGoBack(): boolean
  • Gets a value indicating whether the WebView can navigate back.

    Returns boolean

  • get canGoForward(): boolean
  • Gets a value indicating whether the WebView can navigate forward.

    Returns boolean

  • get interceptScheme(): string
  • Returns string

  • get enterFullscreenEvent(): EventNames
  • Returns EventNames

  • get exitFullscreenEvent(): EventNames
  • Returns EventNames

  • get loadFinishedEvent(): EventNames
  • String value used when hooking to loadFinished event.

    Returns EventNames

  • get loadProgressEvent(): EventNames
  • Returns EventNames

  • get loadStartedEvent(): EventNames
  • String value used when hooking to loadStarted event.

    Returns EventNames

  • get requestPermissionsEvent(): EventNames
  • Returns EventNames

  • get shouldOverrideUrlLoadingEvent(): EventNames
  • String value used when hooking to shouldOverrideUrlLoading event

    Returns EventNames

  • get titleChangedEvent(): EventNames
  • Returns EventNames

  • get webConfirmEvent(): EventNames
  • Returns EventNames

  • get webConsoleEvent(): EventNames
  • Returns EventNames

Methods

  • Platform specific loadData-implementation.

    Parameters

    • src: string

    Returns void

  • Parameters

    • progress: number

    Returns void

  • Platform specific loadURL-implementation.

    Parameters

    • src: string

    Returns void

  • Parameters

    • exitFullscreen: () => void

    Returns boolean

  • Returns boolean

  • Callback for the loadFinished-event. Called from the native-webview

    Parameters

    • url: string
    • Optionalerror: string

    Returns Promise<LoadFinishedEventData>

  • Callback for onLoadStarted-event from the native webview

    Parameters

    • url: string

      URL being loaded

    • OptionalnavigationType: NavigationType

      Type of navigation (iOS-only)

    Returns void

  • Parameters

    • permissions: any

    Returns Promise<false | void>

  • Callback for should override url loading. Called from the native-webview

    Parameters

    • url: string
    • httpMethod: string

      GET, POST etc

    • OptionalnavigationType: NavigationType

      Type of navigation (iOS-only)

    Returns boolean

  • Parameters

    • title: string

    Returns void

  • Parameters

    • message: string
    • callback: () => void

    Returns boolean

  • Parameters

    • message: string
    • callback: (response: boolean) => void

    Returns boolean

  • Parameters

    • message: string
    • lineNo: number
    • level: string

    Returns boolean

  • Parameters

    • message: string
    • defaultText: string
    • callback: (response: string) => void

    Returns boolean

  • Parameters

    • scriptCode: string
    • name: string

    Returns void

  • Auto-load a JavaScript-file after the page have been loaded.

    Parameters

    • resourceName: string
    • filepath: string

    Returns void

  • Auto-load a stylesheet-file after the page have been loaded.

    Parameters

    • resourceName: string
    • filepath: string
    • OptionalinsertBefore: boolean

    Returns void

  • Emit event into the webview.

    Parameters

    • eventName: string
    • data: any

    Returns void

  • Execute JavaScript inside the webview. The code should be wrapped inside an anonymous-function. Larger scripts should be injected with loadJavaScriptFile. NOTE: stringifyResult only applies on iOS.

    Type Parameters

    • T

    Parameters

    • scriptCode: string
    • OptionalstringifyResult: boolean

    Returns Promise<T>

  • Execute a promise inside the webview and wait for it to resolve. Note: The scriptCode must return a promise.

    Type Parameters

    • T

    Parameters

    • scriptCode: string
    • Optionaltimeout: number

    Returns Promise<T>

  • Type Parameters

    • T

    Parameters

    • scriptCodes: string[]
    • Optionaltimeout: number

    Returns Promise<void | T>

  • Helper function, strips 'x-local://' from a resource name

    Parameters

    • resourceName: string

    Returns string

  • Generate script code for loading CSS-file.generateLoadCSSFileScriptCode

    Parameters

    • resourceName: string
    • path: string
    • OptionalinsertBefore: boolean

    Returns Promise<string>

  • Generate script code for loading javascript-file.

    Parameters

    • resourceName: string
    • path: string

    Returns Promise<string>

  • Returns Promise<string>

  • Resolve a "x-local://{name}" to file-path.

    Parameters

    • name: string

    Returns string | void

  • Get document.title NOTE: On Android, if empty returns filename

    Returns Promise<string | void>

  • Navigates back.

    Returns any

  • Navigates forward.

    Returns any

  • Returns Promise<void>

  • Inject WebView JavaScript Bridge.

    Returns Promise<void>

  • Load a JavaScript file on the current page in the webview.

    Parameters

    • scriptName: string
    • filepath: string

    Returns Promise<void>

  • Load multiple JavaScript-files on the current page in the webview.

    Parameters

    Returns Promise<void>

  • Load a stylesheet file on the current page in the webview.

    Parameters

    • stylesheetName: string
    • filepath: string
    • OptionalinsertBefore: boolean

    Returns Promise<void>

  • Load multiple stylesheet-files on the current page in the webview

    Parameters

    Returns Promise<void>

  • A basic method signature to hook an event listener (shortcut alias to the addEventListener method).

    Parameters

    • eventNames: string

      String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by , (e.g. "propertyChange", "change").

    • callback: (data: WebViewEventData) => void

      Callback function which will be executed when event is raised.

    • OptionalthisArg: any

      An optional parameter which will be used as this context for callback execution.

    Returns any

  • Raised before the webview requests an URL. Can be cancelled by settings args.cancel = true in your event handler.

    Parameters

    Returns any

  • Raised when a loadStarted event occurs.

    Parameters

    Returns any

  • Raised when a loadFinished event occurs.

    Parameters

    Returns any

  • Raised when a loadProgress event occurs.

    Parameters

    Returns any

  • Raised when a titleChanged event occurs.

    Parameters

    Returns any

  • Override web alerts to replace them. Call args.cancel() on close.

    Parameters

    Returns any

  • Override web confirm dialogs to replace them. Call args.cancel(res) on close.

    Parameters

    Returns any

  • Override web confirm prompts to replace them. Call args.cancel(res) on close.

    Parameters

    Returns any

  • Get Android WebView console entries.

    Parameters

    Returns any

  • Get Android WebView console entries.

    Parameters

    Returns any

  • Called from delegate on webview event. Triggered by: window.nsWebViewBridge.emit(eventName: string, data: any); inside the webview

    Parameters

    • eventName: string
    • data: any

    Returns void

  • Convert response from WebView into usable JS-type.

    Parameters

    • result: any

    Returns any

  • Register a local resource. This resource can be loaded via "x-local://{name}" inside the webview

    Parameters

    • name: string
    • filepath: string

    Returns void

  • Reloads the current url.

    Returns any

  • Parameters

    • name: string

    Returns void

  • Parameters

    • resourceName: string

    Returns void

  • Parameters

    • resourceName: string

    Returns void

  • Parameters

    • filepath: string

    Returns string | void

  • Stops loading the current content (if any).

    Returns any

  • Unregister a local resource.

    Parameters

    • name: string

    Returns void

  • Parameters

    • message: string
    • Optionaltype: number

    Returns void

  • Parameters

    • zoomFactor: number

    Returns any

  • Returns boolean

  • Returns boolean