Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebView

Hierarchy

Index

Properties

focused

focused: boolean

Is the webview focused.

Readonly id

id: number

Readonly isOverlay

isOverlay: boolean

Is the webview a overlay.

Readonly isReady

isReady: boolean

Is the webview ready.

Readonly isRemote

isRemote: boolean

Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true).

isVisible

isVisible: boolean

View visibility state

Readonly pos

pos: Vector2

Set and get the webview position.

Readonly refCount

refCount: number

Returns the ref count of the entity.

remarks

It's only available in debug-mode.

Readonly remoteID

remoteID: number

The serverside id of this entity.

size

size: Vector2

Set and get the webview size.

Readonly type

Type of the object.

url

url: string

View URL

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

Static Readonly all

all: readonly WebView[]

Static Readonly count

count: number

Static Readonly gpuAccelerationActive

gpuAccelerationActive: boolean

Methods

addOutput

  • Parameters

    Returns void

deleteMeta

  • deleteMeta(key: string): void
  • deleteMeta<K>(key: K): void

destroy

  • destroy(): void
  • Removes the object from the world.

    Returns void

emit

  • emit(eventName: string, ...args: any[]): void
  • Emits specified event across particular WebView.

    Parameters

    • eventName: string

      Name of the event.

    • Rest ...args: any[]

      Rest parameters for emit to send.

    Returns void

focus

  • focus(): void
  • Focuses the webview so it can be interacted with.

    Returns void

getEventListeners

  • getEventListeners(eventName: string | null): readonly ((...args: any[]) => void)[]
  • Gets all the listeners for the specified webview event.

    Parameters

    • eventName: string | null

      Name of the event.

    Returns readonly ((...args: any[]) => void)[]

    Array of listener functions for that event.

getMeta

  • getMeta<K>(key: Exclude<K, keyof ICustomWebViewMeta>): unknown
  • getMeta<K>(key: K): ICustomWebViewMeta[K] | undefined
  • getMeta<V>(key: string): V | undefined
  • Type parameters

    • K: string

    Parameters

    Returns unknown

  • Type parameters

    Parameters

    • key: K

    Returns ICustomWebViewMeta[K] | undefined

  • deprecated

    See ICustomWebViewMeta

    Type parameters

    • V: any

    Parameters

    • key: string

    Returns V | undefined

getMetaDataKeys

  • getMetaDataKeys(): readonly string[]

getOutputs

  • Returns readonly (AudioOutput | number)[]

getSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, keyof ICustomBaseObjectSyncedMeta>): unknown
  • getSyncedMeta<K>(key: K): ICustomBaseObjectSyncedMeta[K] | undefined
  • getSyncedMeta<V>(key: string): V | undefined

getSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]

hasMeta

  • hasMeta(key: string): boolean
  • hasMeta<K>(key: K): boolean
  • Parameters

    • key: string

    Returns boolean

  • Type parameters

    Parameters

    • key: K

    Returns boolean

hasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • hasSyncedMeta<K>(key: K): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True if the meta table contains any data at the specified key or False if not

  • Type parameters

    Parameters

    • key: K

    Returns boolean

off

  • off(eventName: string, listener: (...args: any[]) => void): void
  • Unsubscribes from WebView event handler with specified listener.

    remarks

    Listener should be of the same reference as when event was subscribed.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be removed.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

on

  • on(eventName: string, listener: (...args: any[]) => void): void
  • on(eventName: "load", listener: () => void): void
  • Subscribes to WebView event handler with specified listener.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be added.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Subscribes to WebView event handler with specified listener.

    Parameters

    • eventName: "load"

      Name of the event.

    • listener: () => void

      Listener that should be added.

        • (): void
        • Returns void

    Returns void

once

  • once(eventName: string, listener: (...args: any[]) => void): void
  • Subscribes to WebView event with specified listener, which only triggers once.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be added.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

reload

  • reload(ignoreCache?: boolean): void
  • Parameters

    • Optional ignoreCache: boolean

    Returns void

removeOutput

  • Parameters

    Returns void

setExtraHeader

  • setExtraHeader(header: string, value: string): void
  • Sets the specified header to the specified value.

    Parameters

    • header: string

      Header name.

    • value: string

      Header value.

    Returns void

setMeta

  • setMeta<K>(key: K, value: shared.InterfaceValueByKey<ICustomWebViewMeta, K>): void
  • setMeta<K>(key: K, value: ICustomWebViewMeta[K]): void
  • setMeta<V, K>(key: K, value: shared.InterfaceValueByKey<ICustomWebViewMeta, K, V>): void

setZoomLevel

  • setZoomLevel(value: number): void
  • Sets the zoom level for webview.

    Parameters

    • value: number

      Zoom level value.

    Returns void

unfocus

  • unfocus(): void
  • Unfocuses the webview so it ignores user input.

    Returns void

Static getByID

  • getByID(id: number): WebView | null
  • Retrieves the webview from the pool.

    Parameters

    • id: number

      The id of the webview.

    Returns WebView | null

    Entity if it was found, otherwise null.

Static getByRemoteID