Update: Nevermind, I found this https://github.com/varabyte/kobweb/blob/main/frontend/silk-widgets/README.mdHi friends, is there some guidance available on how to add Kobweb into an existing Compose HTML project?I'd like to explore the possibility of using Kobweb to create Google Chrome Extensions. I know it's possible with Compose HTML and Kobweb is based upon it, so was wondering if someone has already tried doing this?
s
S.
05/31/2025, 9:44 PM
yes, using kobweb for chrome extensions is possible but there are a few quirks. that link is a good start
S.
05/31/2025, 9:45 PM
will your extension be running as a extension popup or also as a content script?
s
Shubham Singh
05/31/2025, 9:45 PM
As a popup (not sure about the other one, don't know about it)
s
S.
05/31/2025, 9:47 PM
content script means running js alongside the website itself, so you can for example modify parts of the original html
s
Shubham Singh
05/31/2025, 9:48 PM
Understood, popup only in that case 👍
s
S.
05/31/2025, 9:55 PM
when using kobweb-core the router will crash and 404 because the popup doesn't have a
location
, one way to fix that is via an error handler
Copy code
@InitKobweb
fun initKobweb(ctx: InitKobwebContext) {
ctx.router.setErrorHandler {
YourApp()
}
}
the other way is by using silk-widgets only which requires a bit of manual setup mentioned in the link you found