Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
phantomjs handling for emacs
Branch: master
Pull request Compare This branch is 16 commits behind nicferrier:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README.creole
ghostweb.js
phantomjs.el

README.creole

Stuff for working with phantomjs from within Emacs.

Dependancies

This package requires phantomjs v1.5 to be installed. This package does no checking (yet) for that dependancy.

The location of phantomjs can be controlled with the customizaton variable:

phantomjs-home

which is expanded before being used (so you can use ~ and .. and such like).

Using

Here's some illustrative EmacsLisp:

(defun test-phantom-complete ()
  (elnode-stop 8005)
  (message "test run done"))

(let (phantom-server)
  (setq phantom-server
        (phantomjs-server
         'servertest 6101
         'test-phantom-complete))
  (sleep-for 2)
  ;; Open a url
  (phantomjs-open
   phantom-server
   "http://localhost:8005/talk/stuff/html/index.html"
   (lambda (status arg)
     (sleep-for 3)
     ;; Then exit
     (phantomjs-exit
      arg
      (lambda (status arg)
        (message "plaintalk exited phantom"))))))

It's also possible to call Javascript functions inside the opened web page. That will have to wait for an README.

Building the package

Use make to rebuild this package:

make clean all

will produce the appropriately versioned phantomjs tar file which can then be installed (locally) with:

M-x package-install-file
Something went wrong with that request. Please try again.