While some content on writing web applications in Kotlin has been published, the niche of writing browser extensions has seemed to be ignored until now. That’s why in this post we are going explore the process of writing a simple extension for Firefox using Kotlin JS.
We proceed through the wizard until the empty project is created and opened.
As the next step, we will enable the Dead Code Elimination plugin for KotlinJS. This is necessary because a Kotlin JS program needs to bundle the Kotlin stdlib which is over a megabyte in size. However, we can reduce the size of our compiled code drastically by removing code that’s never getting called.
To enable the plugin, simply add the following line to the build.gradlefile.
apply plugin: ‘kotlin-dce-js’
Creating the extension manifest
In the next step, we add the manifest file which is required for a Firefox extension. This fileis called manifest.json and resided in the root directory of our project. The file should have the following content.
“name”: “Kotlin Borderify”,
“description”: “Adds a red border to kotlinlang.org”,
In this file we declare that our extension will inject a content script in any website matching the pattern *://kotlinlang.org/* . The necessary script files are are the Kotlin stdlib kotlin.js as well as our code in the kt-borderify.js file.
Two problem which occur with most of developer when they start with Google’s Materialized theme. In my project i also used this awesome designing them but i stuck with problems in Multiple select option.
how to make 3D objects with WebGL using Three.js and if you’re new for this then you can read that article from here. But today we’re taking some extra step in this field and now you can learn how to drag drop that 3d objects which you made in previous tutorial.