tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

2018-08-31-release-0.21.markdown (4038B)



layout: post title: "🎉 Release: Android Components 0.21" date: 2018-08-31 14:40:00 +0200 categories: releases author: sebastian


Milestone, API reference

* Android support libraries 27.1.1 * Kotlin Standard library 1.2.61 🔺 * Kotlin coroutines 0.23.4 * GeckoView * Nightly: 63.0.20180830111743 🔺 * Beta: 62.0b21 (7ce198bb7ce027d450af3f69a609896671adfab8) 🔺 * Release: 61.0 (785d242a5b01d5f1094882aa2144d8e5e2791e06)

`Kotlin // DefaultSettings can be set on GeckoEngine and SystemEngine. GeckoEngine(runtime, DefaultSettings( trackingProtectionPolicy = TrackingProtectionPolicy.all(), javascriptEnabled = false)) `

* Added support for intercepting request and injecting custom content. This can be used for internal pages (e.g. focus:about, firefox:home) and error pages. `Kotlin // GeckoEngine (beta/nightly) and SystemEngine support request interceptors. GeckoEngine(runtime, DefaultSettings( requestInterceptor = object : RequestInterceptor { override fun onLoadRequest(session: EngineSession, uri: String): RequestInterceptor.InterceptionResponse? { return when (uri) { "sample:about" -> RequestInterceptor.InterceptionResponse("<h1>I am the sample browser</h1>") else -> null } } } ) ` * Added APIs to support "find in page". `Kotlin // Finds and highlights all occurrences of "hello" engineSession.findAll("hello")

// Finds and highlights the next or previous match engineSession.findNext(forward = true)

// Clears the highlighted results engineSession.clearFindMatches()

// The current state of "Find in page" can be observed on a Session object: session.register(object : Session.Observer { fun onFindResult(session: Session, result: FindResult) { // ... } }) `

`Kotlin engineSession.setDesktopMode(true, reload = true) `

`Kotlin session.register(object : Session.Observer { fun onLongPress(session: Session, hitResult: HitResult): Boolean { // HitResult is a sealed class representing the different types of content that can be long pressed. // ...

// Returning true will "consume" the event. If no observer consumes the event then it will be // set on the Session object to be consumed at a later time. return true } }) `

`Kotlin expectException(IllegalStateException::class) { // Do something that should throw IllegalStateException.. } `