Skip to content

Instantly share code, notes, and snippets.

@cypressious
Last active November 18, 2017 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cypressious/5292a9de1726ab1a2fef9e14c3f919bd to your computer and use it in GitHub Desktop.
Save cypressious/5292a9de1726ab1a2fef9e14c3f919bd to your computer and use it in GitHub Desktop.
Firefox Webextension in Kotlin
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin2js'
apply plugin: 'kotlin-dce-js'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
}
compileKotlin2Js {
kotlinOptions.sourceMap = true
}
import kotlin.browser.document
fun main(args: Array<String>) {
document.body?.style?.border = "5px solid red"
}
{
"manifest_version": 2,
"name": "Kotlin Borderify",
"version": "1.0",
"description": "Adds a red border to kotlinlang.org",
"content_scripts": [
{
"matches": [
"*://kotlinlang.org/*"
],
"js": [
"build/classes/kotlin/main/min/kotlin.js",
"build/classes/kotlin/main/min/kt-borderify.js"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment