Khroma is a ClojureScript library which provides access to Chrome Extension API. It wraps API with idiomatic functions and heavily uses core.async for asynchronous API interaction.
Khroma is under active development, but not all APIs are implemented yet. The long term goal is to cover all Chrome and Chrome OS API's to make use of ClojureScript for extensions and applications development as convenient as possible.
Khroma 0.3.0 contains breaking changes from 0.1.0. Make sure you read the change log.
Add the following dependency to your project.clj
file:
[khroma "0.3.0"]
This repository will be maintained using git-flow.
develop
and master
branches can be considered set in stone, but I'll be developing this publicly - if you see a feature branch, assume it's mercurial and may be amended or rebased in the future.
Pull requests are welcome, please make them from your clone's develop
branch.
- Finish exposing the events on web-navigation
- Event filtering examples
on-command
event and examples- Finish exposing
tabs
andwindows
functions
See khroma-tests.md
(ns example
(:require [khroma.runtime :as runtime))
; receive messages for extension
(let [messages (runtime/on-message)]
(go-loop []
(when-let [message (<! messages)]
(process-message message)
(recur)))
; send message to another extension
(runtime/send-message
{:message-data "xx" :something-else "yyy"}
{:extensionId "some.other.extension"
:responseCallback
(fn [response]
(handle-response response))})
Copyright © 2015 SUPREMATIC.
Includes khroma-tests
© 2015 Numergent Limited.
Distributed under the Eclipse Public License, the same as Clojure.