Building a Browser Extension with Kotlin
summary
Kotlin compiled to JavaScript is used to build a fully working, type-safe browser extension by generating Kotlin/JS external declarations for the WebExtensions API. The approach parses MDN JSON with a generator mini-compiler that emits Kotlin code, integrates with Gradle and the Kotlin/JS toolchain, and produces generated interfaces that enable IDE completion and catch real type errors at compile time. The result is a small Firefox extension using the WebExtensions manifest and a near-instant edit→reload workflow.
AI-written summary · about
chapters (10)
- 0:00Browser extensions with Kotlin
- 2:54Why Kotlin for dynamic features
- 5:23WebExtensions standard support
- 9:20Type-safe JS API declarations
- 12:26JavaScript interop with external classes
- 17:58Code generation from JS parameters
- 21:42Testing in Firefox
- 26:32Project setup with Kotlin DSL
- 28:26Running and debugging
- 34:05Q&A
related talks
41mBuild a Browser by Kotlin
45mFrontend Kotlin from the Trenches
22mKotlin/JS in 1.4 and Beyond
34mIntegrating Kotlin/JS in a Kotlin Multiplatform library
33mUsing Kotlin for JS Client and JVM Server
43mThe State of Kotlin JS
01h 01mKotlin as a Language for Frontend Development
26mBuild your own compiler with KSP
