No description, website, or topics provided.
JavaScript Emacs Lisp
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
crxel.crx
.gitignore
README.md
crxel.el

README.md

Commentary

'crxel' is an interface of Google Chrome Extensions API for Emacs Lisp.

Requirements

How to install

Clone repository

git clone https://github.com/ahyatt/emacs-websocket
git clone https://github.com/mechairoi/crxel

Load chrome extension

  1. Visit chrome://extensions in your browser.
  2. Ensure that the Developer Mode checkbox is checked.
  3. Click Load unpacked extension… and select /path/to/crxel/crxel.crx

Configure Emacs

;; ~/.emacs.d/
(add-to-list 'load-path "/path/to/emacs-websocket")
(add-to-list 'load-path "/path/to/crxel")
(require 'crxel)
(crxel/start 9649)

Samples

;; Evaluate "1+1" in javascript and `print` the outome "2"
(crxel/eval "1+1" :success 'print :fail 'error)

or

;; Call asynchronous API `chrome.tabs.query`
;; and return the outcome by `window.crxel.callback`
(crxel/eval "var callback = window.crxel.callback;
             chrome.tabs.query({}, function(tabs) {
                 callback(JSON.stringify(tabs));
             });"
            :async t
            :success (lambda (data)
                       (print (json-read-from-string data)))
            :fail 'error)

Sample applications