pl.wendigo.chrome.domain.schema.SchemaDomain.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chrome-reactive-kotlin Show documentation
Show all versions of chrome-reactive-kotlin Show documentation
Chrome Reactive - low level, remote chrome debugger protocol client (DevTools)
package pl.wendigo.chrome.domain.schema
/**
* Provides information about the protocol schema.
*/
class SchemaDomain internal constructor(private val connectionRemote : pl.wendigo.chrome.DebuggerProtocol) {
/**
* Returns supported domains.
*/
fun getDomains() : io.reactivex.Single {
return connectionRemote.runAndCaptureResponse("Schema.getDomains", null, GetDomainsResponse::class.java).map {
it.value()
}
}
/**
* Returns flowable capturing all Schema domains events.
*/
fun events() : io.reactivex.Flowable {
return connectionRemote.captureAllEvents().map { it.value() }.filter {
it.protocolDomain() == "Schema"
}
}
}
/**
* Represents response frame for Schema.getDomains method call.
*
* Returns supported domains.
*/
data class GetDomainsResponse(
/**
* List of supported domains.
*/
val domains : List
)