kvision / pl.treksoft.kvision.electron / Session

Session

open external class Session : EventEmitter

Constructors

<init>

Session()

Properties

cookies

open var cookies: Cookies

protocol

open var protocol: Protocol

webRequest

open var webRequest: WebRequest

Functions

addListener

open fun addListener(event: String, listener: (event: Event, item: DownloadItem, webContents: WebContents) -> Unit): Session

allowNTLMCredentialsForDomains

open fun allowNTLMCredentialsForDomains(domains: String): Unit

clearAuthCache

open fun clearAuthCache(options: RemovePassword, callback: Function<*>? = definedExternally): Unit
open fun clearAuthCache(options: RemoveClientCertificate, callback: Function<*>? = definedExternally): Unit

clearCache

open fun clearCache(callback: Function<*>): Unit

clearHostResolverCache

open fun clearHostResolverCache(callback: Function<*>? = definedExternally): Unit

clearStorageData

open fun clearStorageData(options: ClearStorageDataOptions? = definedExternally, callback: Function<*>? = definedExternally): Unit

createInterruptedDownload

open fun createInterruptedDownload(options: CreateInterruptedDownloadOptions): Unit

disableNetworkEmulation

open fun disableNetworkEmulation(): Unit

enableNetworkEmulation

open fun enableNetworkEmulation(options: EnableNetworkEmulationOptions): Unit

flushStorageData

open fun flushStorageData(): Unit

getBlobData

open fun getBlobData(identifier: String, callback: (<ERROR CLASS>) -> Unit): Unit

getCacheSize

open fun getCacheSize(callback: (size: Number) -> Unit): Unit

getPreloads

open fun getPreloads(): Array<String>

getUserAgent

open fun getUserAgent(): String

on

open fun on(event: String, listener: (event: Event, item: DownloadItem, webContents: WebContents) -> Unit): Session

once

open fun once(event: String, listener: (event: Event, item: DownloadItem, webContents: WebContents) -> Unit): Session

removeListener

open fun removeListener(event: String, listener: (event: Event, item: DownloadItem, webContents: WebContents) -> Unit): Session

resolveProxy

open fun resolveProxy(url: String, callback: (proxy: String) -> Unit): Unit

setCertificateVerifyProc

open fun setCertificateVerifyProc(proc: (request: CertificateVerifyProcRequest, callback: (verificationResult: Number) -> Unit) -> Unit): Unit

setDownloadPath

open fun setDownloadPath(path: String): Unit

setPermissionRequestHandler

open fun setPermissionRequestHandler(handler: (webContents: WebContents, permission: String, callback: (permissionGranted: Boolean) -> Unit, details: PermissionRequestHandlerDetails) -> Unit?): Unit

setPreloads

open fun setPreloads(preloads: Array<String>): Unit

setProxy

open fun setProxy(config: Config, callback: Function<*>): Unit

setUserAgent

open fun setUserAgent(userAgent: String, acceptLanguages: String? = definedExternally): Unit

Inherited Functions

addListener

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

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<*>>

on

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

once

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

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

removeListener

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

setMaxListeners

open fun setMaxListeners(n: Number): EventEmitter

Companion Object Properties

defaultSession

var defaultSession: Session

Companion Object Functions

fromPartition

fun fromPartition(partition: String, options: FromPartitionOptions? = definedExternally): Session

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.