Skip to content

mechairoi/crxel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published