kvision / pl.treksoft.kvision.electron / WebContents

WebContents

open external class WebContents : EventEmitter

Constructors

<init>

WebContents()

Properties

debugger

open var debugger: Debugger

devToolsWebContents

open var devToolsWebContents: WebContents

hostWebContents

open var hostWebContents: WebContents

id

open var id: Number

session

open var session: Session

Functions

addListener

open fun addListener(event: String, listener: (event: Event, input: Input) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit) -> Unit): WebContents
open fun addListener(event: String, listener: (level: Number, message: String, line: Number, sourceId: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, params: ContextMenuParams) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, killed: Boolean) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, type: String, image: NativeImage?, scale: Number?, size: Size?, hotspot: Point?) -> Unit): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: (event: Event, webContents: WebContents) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, color: String?) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, errorCode: Number, errorDescription: String, validatedURL: String, isMainFrame: Boolean) -> Unit): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: (event: Event, isMainFrame: Boolean) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, oldURL: String, newURL: String, isMainFrame: Boolean, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, status: Boolean, newURL: String, originalURL: String, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any, resourceType: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String, isMainFrame: Boolean) -> Unit): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: (event: Event) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, result: Result) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, request: Request, authInfo: AuthInfo, callback: (username: String, password: String) -> Unit) -> Unit): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: Function<*>): WebContents
open fun addListener(event: String, listener: (event: Event, url: String, frameName: String, dynamic, options: Any, additionalFeatures: Array<String>) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, favicons: Array<String>) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, name: String, version: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, devices: Array<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String, certificateList: Array<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, webPreferences: Any, params: Any) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun addListener(event: String, listener: (event: Event) -> Unit): WebContents

addWorkSpace

open fun addWorkSpace(path: String): Unit

beginFrameSubscription

open fun beginFrameSubscription(callback: (<ERROR CLASS>, dirtyRect: Rectangle) -> Unit): Unit
open fun beginFrameSubscription(onlyDirty: Boolean, callback: (<ERROR CLASS>, dirtyRect: Rectangle) -> Unit): Unit

canGoBack

open fun canGoBack(): Boolean

canGoForward

open fun canGoForward(): Boolean

canGoToOffset

open fun canGoToOffset(offset: Number): Boolean

capturePage

open fun capturePage(callback: (image: NativeImage) -> Unit): Unit
open fun capturePage(rect: Rectangle, callback: (image: NativeImage) -> Unit): Unit

clearHistory

open fun clearHistory(): Unit

closeDevTools

open fun closeDevTools(): Unit

copy

open fun copy(): Unit

copyImageAt

open fun copyImageAt(x: Number, y: Number): Unit

cut

open fun cut(): Unit

delete

open fun delete(): Unit

disableDeviceEmulation

open fun disableDeviceEmulation(): Unit

downloadURL

open fun downloadURL(url: String): Unit

enableDeviceEmulation

open fun enableDeviceEmulation(parameters: Parameters): Unit

endFrameSubscription

open fun endFrameSubscription(): Unit

executeJavaScript

open fun executeJavaScript(code: String, userGesture: Boolean? = definedExternally, callback: ((result: Any) -> Unit)? = definedExternally): Promise<Any>

findInPage

open fun findInPage(text: String, options: FindInPageOptions? = definedExternally): Number

focus

open fun focus(): Unit

getFrameRate

open fun getFrameRate(): Number

getOSProcessId

open fun getOSProcessId(): Number

getPrinters

open fun getPrinters(): Array<PrinterInfo>

getTitle

open fun getTitle(): String

getURL

open fun getURL(): String

getUserAgent

open fun getUserAgent(): String

getWebRTCIPHandlingPolicy

open fun getWebRTCIPHandlingPolicy(): String

getZoomFactor

open fun getZoomFactor(callback: (zoomFactor: Number) -> Unit): Unit

getZoomLevel

open fun getZoomLevel(callback: (zoomLevel: Number) -> Unit): Unit

goBack

open fun goBack(): Unit

goForward

open fun goForward(): Unit

goToIndex

open fun goToIndex(index: Number): Unit

goToOffset

open fun goToOffset(offset: Number): Unit

hasServiceWorker

open fun hasServiceWorker(callback: (hasWorker: Boolean) -> Unit): Unit

insertCSS

open fun insertCSS(css: String): Unit

insertText

open fun insertText(text: String): Unit

inspectElement

open fun inspectElement(x: Number, y: Number): Unit

inspectServiceWorker

open fun inspectServiceWorker(): Unit

invalidate

open fun invalidate(): Unit

isAudioMuted

open fun isAudioMuted(): Boolean

isCrashed

open fun isCrashed(): Boolean

isDestroyed

open fun isDestroyed(): Boolean

isDevToolsFocused

open fun isDevToolsFocused(): Boolean

isDevToolsOpened

open fun isDevToolsOpened(): Boolean

isFocused

open fun isFocused(): Boolean

isLoading

open fun isLoading(): Boolean

isLoadingMainFrame

open fun isLoadingMainFrame(): Boolean

isOffscreen

open fun isOffscreen(): Boolean

isPainting

open fun isPainting(): Boolean

isWaitingForResponse

open fun isWaitingForResponse(): Boolean

loadFile

open fun loadFile(filePath: String): Unit

loadURL

open fun loadURL(url: String, options: LoadURLOptions? = definedExternally): Unit

on

open fun on(event: String, listener: (event: Event, input: Input) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit) -> Unit): WebContents
open fun on(event: String, listener: (level: Number, message: String, line: Number, sourceId: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, params: ContextMenuParams) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, killed: Boolean) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, type: String, image: NativeImage?, scale: Number?, size: Size?, hotspot: Point?) -> Unit): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: (event: Event, webContents: WebContents) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, color: String?) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, errorCode: Number, errorDescription: String, validatedURL: String, isMainFrame: Boolean) -> Unit): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: (event: Event, isMainFrame: Boolean) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, oldURL: String, newURL: String, isMainFrame: Boolean, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, status: Boolean, newURL: String, originalURL: String, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any, resourceType: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String, isMainFrame: Boolean) -> Unit): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: (event: Event) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, result: Result) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, request: Request, authInfo: AuthInfo, callback: (username: String, password: String) -> Unit) -> Unit): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: Function<*>): WebContents
open fun on(event: String, listener: (event: Event, url: String, frameName: String, dynamic, options: Any, additionalFeatures: Array<String>) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, favicons: Array<String>) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, name: String, version: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, devices: Array<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String, certificateList: Array<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, webPreferences: Any, params: Any) -> Unit): WebContents
open fun on(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun on(event: String, listener: (event: Event) -> Unit): WebContents

once

open fun once(event: String, listener: (event: Event, input: Input) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit) -> Unit): WebContents
open fun once(event: String, listener: (level: Number, message: String, line: Number, sourceId: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, params: ContextMenuParams) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, killed: Boolean) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, type: String, image: NativeImage?, scale: Number?, size: Size?, hotspot: Point?) -> Unit): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: (event: Event, webContents: WebContents) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, color: String?) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, errorCode: Number, errorDescription: String, validatedURL: String, isMainFrame: Boolean) -> Unit): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: (event: Event, isMainFrame: Boolean) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, oldURL: String, newURL: String, isMainFrame: Boolean, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, status: Boolean, newURL: String, originalURL: String, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any, resourceType: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String, isMainFrame: Boolean) -> Unit): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: (event: Event) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, result: Result) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, request: Request, authInfo: AuthInfo, callback: (username: String, password: String) -> Unit) -> Unit): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: Function<*>): WebContents
open fun once(event: String, listener: (event: Event, url: String, frameName: String, dynamic, options: Any, additionalFeatures: Array<String>) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, favicons: Array<String>) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, name: String, version: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, devices: Array<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String, certificateList: Array<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, webPreferences: Any, params: Any) -> Unit): WebContents
open fun once(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun once(event: String, listener: (event: Event) -> Unit): WebContents

openDevTools

open fun openDevTools(options: OpenDevToolsOptions? = definedExternally): Unit

paste

open fun paste(): Unit

pasteAndMatchStyle

open fun pasteAndMatchStyle(): Unit

print

open fun print(options: PrintOptions? = definedExternally, callback: ((success: Boolean) -> Unit)? = definedExternally): Unit

printToPDF

open fun printToPDF(options: PrintToPDFOptions, callback: (Error, <ERROR CLASS>) -> Unit): Unit

redo

open fun redo(): Unit

reload

open fun reload(): Unit

reloadIgnoringCache

open fun reloadIgnoringCache(): Unit

removeListener

open fun removeListener(event: String, listener: (event: Event, input: Input) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit) -> Unit): WebContents
open fun removeListener(event: String, listener: (level: Number, message: String, line: Number, sourceId: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, params: ContextMenuParams) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, killed: Boolean) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, type: String, image: NativeImage?, scale: Number?, size: Size?, hotspot: Point?) -> Unit): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: (event: Event, webContents: WebContents) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, color: String?) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, errorCode: Number, errorDescription: String, validatedURL: String, isMainFrame: Boolean) -> Unit): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: (event: Event, isMainFrame: Boolean) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, oldURL: String, newURL: String, isMainFrame: Boolean, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, status: Boolean, newURL: String, originalURL: String, httpResponseCode: Number, requestMethod: String, referrer: String, headers: Any, resourceType: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String, isMainFrame: Boolean) -> Unit): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: (event: Event) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, result: Result) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, request: Request, authInfo: AuthInfo, callback: (username: String, password: String) -> Unit) -> Unit): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: Function<*>): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String, frameName: String, dynamic, options: Any, additionalFeatures: Array<String>) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, favicons: Array<String>) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, name: String, version: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, devices: Array<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String, certificateList: Array<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, webPreferences: Any, params: Any) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event, url: String) -> Unit): WebContents
open fun removeListener(event: String, listener: (event: Event) -> Unit): WebContents

removeWorkSpace

open fun removeWorkSpace(path: String): Unit

replace

open fun replace(text: String): Unit

replaceMisspelling

open fun replaceMisspelling(text: String): Unit

savePage

open fun savePage(fullPath: String, saveType: String, callback: (Error) -> Unit): Boolean
open fun savePage(fullPath: String, saveType: String, callback: (Error) -> Unit): Boolean
open fun savePage(fullPath: String, saveType: String, callback: (Error) -> Unit): Boolean

selectAll

open fun selectAll(): Unit

send

open fun send(channel: String, vararg args: Any): Unit

sendInputEvent

open fun sendInputEvent(event: Event): Unit

setAudioMuted

open fun setAudioMuted(muted: Boolean): Unit

setDevToolsWebContents

open fun setDevToolsWebContents(devToolsWebContents: WebContents): Unit

setFrameRate

open fun setFrameRate(fps: Number): Unit

setIgnoreMenuShortcuts

open fun setIgnoreMenuShortcuts(ignore: Boolean): Unit

setLayoutZoomLevelLimits

open fun setLayoutZoomLevelLimits(minimumLevel: Number, maximumLevel: Number): Unit

setSize

open fun setSize(options: SizeOptions): Unit

setUserAgent

open fun setUserAgent(userAgent: String): Unit

setVisualZoomLevelLimits

open fun setVisualZoomLevelLimits(minimumLevel: Number, maximumLevel: Number): Unit

setWebRTCIPHandlingPolicy

open fun setWebRTCIPHandlingPolicy(policy: String): Unit
open fun setWebRTCIPHandlingPolicy(policy: String): Unit
open fun setWebRTCIPHandlingPolicy(policy: String): Unit
open fun setWebRTCIPHandlingPolicy(policy: String): Unit

setZoomFactor

open fun setZoomFactor(factor: Number): Unit

setZoomLevel

open fun setZoomLevel(level: Number): Unit

showDefinitionForSelection

open fun showDefinitionForSelection(): Unit

startDrag

open fun startDrag(item: Item): Unit

startPainting

open fun startPainting(): Unit

stop

open fun stop(): Unit

stopFindInPage

open fun stopFindInPage(action: String): Unit
open fun stopFindInPage(action: String): Unit
open fun stopFindInPage(action: String): Unit

stopPainting

open fun stopPainting(): Unit

toggleDevTools

open fun toggleDevTools(): Unit

undo

open fun undo(): Unit

unregisterServiceWorker

open fun unregisterServiceWorker(callback: (success: Boolean) -> Unit): Unit

unselect

open fun unselect(): Unit

Inherited Functions

emit

open fun emit(event: String, vararg args: Any): Boolean

eventNames

open fun eventNames(): Array<String>

getMaxListeners

open fun getMaxListeners(): Number

listenerCount

open fun listenerCount(type: String): Number

listeners

open fun listeners(event: String): Array<Function<*>>

prependListener

open fun prependListener(event: String, listener: Function<*>): EventEmitter

prependOnceListener

open fun prependOnceListener(event: String, listener: Function<*>): EventEmitter

removeAllListeners

open fun removeAllListeners(event: String? = definedExternally): EventEmitter

setMaxListeners

open fun setMaxListeners(n: Number): EventEmitter

Companion Object Functions

fromId

fun fromId(id: Number): WebContents

getAllWebContents

fun getAllWebContents(): Array<WebContents>

getFocusedWebContents

fun getFocusedWebContents(): WebContents

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.