android-components / mozilla.components.browser.session / Session

Session

class Session : Observable<Observer> (source)

Value type that represents the state of a browser session. Changes can be observed.

Types

FindResult

data class FindResult

A value type representing a result of a "find in page" operation.

Observer

interface Observer

Interface to be implemented by classes that want to observe a session.

SecurityInfo

data class SecurityInfo

A value type holding security information for a Session.

Source

enum class Source

Represents the origin of a session to describe how and why it was created.

Constructors

<init>

Session(initialUrl: String, private: Boolean = false, source: Source = Source.NONE, id: String = UUID.randomUUID().toString(), delegate: Observable<Observer> = ObserverRegistry())

Value type that represents the state of a browser session. Changes can be observed.

Properties

appPermissionRequest

var appPermissionRequest: Consumable<PermissionRequest>

Consumable permission request for the app. A PermissionRequest must be consumed i.e. either PermissionRequest.grant or PermissionRequest.reject must be called.

canGoBack

var canGoBack: Boolean

Navigation state, true if there's an history item to go back to, otherwise false.

canGoForward

var canGoForward: Boolean

Navigation state, true if there's an history item to go forward to, otherwise false.

contentPermissionRequest

var contentPermissionRequest: Consumable<PermissionRequest>

Consumable permission request from web content. A PermissionRequest must be consumed i.e. either PermissionRequest.grant or PermissionRequest.reject must be called. A content permission request can also be cancelled, which will result in a new empty Consumable.

customTabConfig

var customTabConfig: CustomTabConfig?

Configuration data in case this session is used for a Custom Tab.

desktopMode

var desktopMode: Boolean

Desktop Mode state, true if the desktop mode is requested, otherwise false.

download

var download: Consumable<Download>

Last download request if it wasn't consumed by at least one observer.

findResults

var findResults: List<FindResult>

List of results of that latest "find in page" operation.

fullScreenMode

var fullScreenMode: Boolean

Exits fullscreen mode if it's in that state.

hitResult

var hitResult: Consumable<HitResult>

The target of the latest long click operation.

id

val id: String

loading

var loading: Boolean

Loading state, true if this session's url is currently loading, otherwise false.

private

val private: Boolean

progress

var progress: Int

The progress loading the current URL.

searchTerms

var searchTerms: String

The currently / last used search terms.

securityInfo

var securityInfo: SecurityInfo

Security information indicating whether or not the current session is for a secure URL, as well as the host and SSL certificate authority, if applicable.

source

val source: Source

thumbnail

var thumbnail: Bitmap?

The target of the latest thumbnail.

title

var title: String

The title of the currently displayed website changed.

trackerBlockingEnabled

var trackerBlockingEnabled: Boolean

Tracker blocking state, true if blocking trackers is enabled, otherwise false.

trackersBlocked

var trackersBlocked: List<String>

List of URIs that have been blocked in this session.

url

var url: String

The currently loading or loaded URL.

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

isCustomTabSession

fun isCustomTabSession(): Boolean

Returns whether or not this session is used for a Custom Tab.

toString

fun toString(): String