Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote controlling Chrome / Chromium browser from Emacs?

I'm looking for an Emacs (& Chrome) package that makes it possible to communicate between each application -- especially to remote-control Chrome from Emacs, something similar to Mozrepl for FireFox.

I found one package called skewer-mode but it relies, from my point of view, on some unnecessary package like js2-mode.

So, my question is: is there any lightweight emacs/chrome package that enables emacs -> chrome communication?

like image 571
OTZ Avatar asked Mar 05 '14 08:03

OTZ


2 Answers

There is also the Mini Kite Mode. It's description contains a rundown of the difference between this package and similar ones:

Debugging JavaScript in WebKit browser (Chrome) from Emacs is always fun. There's a couple of packages implement that idea already: Skewer, Kite and Wooky with different feature sets. However, due to my specific workflow and needs, they are not suitable, so I decided to wrote this.

  • Skewer: I don't feel like injecting a custom script or running a web server within Emacs. Moreover, the simple evaluation requires JavaScript to be structured in a specific way and doesn't employ the WebKit Debuger's power, especially live updating scripts. I love this feature a lot since it can be used to redefine closures and event handlers. Browser agnostic is a nice thing to have, but it is not crucial for me.
  • Kite: Is huge and full featured, but I do not need debugging, it is better suited for something like realgud.
  • Wooky: sounds perfect for me, except it doesn't support live updating.
  • SwankJS: full-featured and browser agnostic, however it is complicated to setup and somewhat unreliable.

There is also JSS or jsSlime, which is pretty close to Kite in terms of functionality. Here is a rundown between JSS and Kite by the author of JSS, from a reddit comment:

i kind of have the feeling that jss is aimed at javascript developers (and i am a javascript developer), the debugger and the uri-source-code mapping where the first things i added; while kite is aimed more at (or just also at) html/css devs (the live updating, the color browser/inspector). having said that, here's a 2 second comparison:

  • kite implements much more of the debugger than jss (DOM and Heap viewers, a css color inspecter, just to name a few things)
  • kite implements live editing of js and css, jss does not (and it's not really a priority for me)
  • jss implements the actual js debugger (view stack frames, eval-in-frame, resume frame) which kite, according to its docs, does not.
  • kite is older, so i'd assume it's been used more.
  • kite uses a library (ewoc) for some of the model-view stuff that jss reimplements itself.
  • jss can (and is slowly getting there) work with firefox as well.
  • jss also includes (totally unrelated to the browser) a mode for creating and viewing custom http requests (the http-repl)
like image 170
arvidj Avatar answered Oct 21 '22 01:10

arvidj


You might be interested in my project wooky.el – it can eval defuns in the context of a Chrome tab and reload tabs. However, it relies on js2-mode as well (to find defun at point).

The Kite package is a much more powerful Chrome DevTools front-end. It has a debugger, REPL, DOM inspector and more. It's on MELPA, too. This package doesn't depend on js2-mode.

Satisfied?

like image 41
katspaugh Avatar answered Oct 21 '22 01:10

katspaugh