Skip to content
/ Kromex Public template

Kromex is an extension template written in Kotlin, mainly made for Chrome

Notifications You must be signed in to change notification settings

DatL4g/Kromex

Repository files navigation

Kromex Logo

Kromex

  • Ever wanted to create a Web-Extension with Kotlin-JS?
  • You had no idea where to start or implementation was to difficult?

Kromex to the rescue!

Issues Stars Forks Contributors License Kotlin IntelliJ IDEA

Kromex is a Free and Open Source extension template written in Kotlin

  • Provides: popup,content and background out of the box
  • Provides: base module for extension API implementation
  • Provides: easy build process
  • Uses: Manifest v3
  • Uses: Kotlin Gradle

Table of content

Getting Started

Fork this repository or click Use this template.

Import your new repository into IntelliJ or any other IDE of your choice.

Create your extension

I provided all modules you need out of the box and even some small examples.

Do whatever you want with it.

Make sure to replace "Kromex" with your actual extension name.

Limitations

It's possible that the code were not generated correctly in some cases. Please create an issue if you've found any wrong parameter/return type etc.

Enums

Enums will be generated as well, however if any function/event returns an enum like:

browser.runtime.getPlatformInfo()

The enum won't be accessible as such. Instead, call the toString() method on it and then create the enum type by this value, e.g.:

browser.runtime.getPlatformInfo().collect {
    console.log(it.os == PlatformOs.linux)
    console.log(PlatformOs.valueOf(it.os.toString()) == PlatformOs.linux)
}

This will output:

false
true

Build

Generate APIs

This is useful e.g. if the API specifications changed.

Make sure the previous generated files are deleted
./gradlew :generate:clean
Generate the files by its specifications
./gradlew :generate:run

Export your extension

Rebuild JS files

This step is not needed if you've edited resource files only.

./gradlew clean assemble
Copy needed files to /build/extension
./gradlew extension

Contributing

When you face any bugs or problems please open an Issue.

To add functionality fork the project and create a pull request afterwards. You should know how that works if you are a developer :) You can add yourself to the list below if you want then.

Maintainers

Avatar Contributor
DatLag

Support the project

Github-sponsors PayPal Patreon

Supporting this project helps to keep it up-to-date. You can donate if you want or contribute to the project as well. This shows that the app is used by people and it's worth to maintain.