• Stars
    star
    355
  • Rank 119,764 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Sublime Text plugin to execute JavaScript in Google Chrome

ChromeREPL

Sublime Text 3 Python 3.3 apm

A SublimeText 3 Plugin to use Chrome as your REPL.

Execute JavaScript in your browser. Interact with your running webapps. Live code your brains out!

Why?

Because Chrome ain't no text editor. Anything longer than a line is a pain, and so is recalling what you typed earlier.

Screencast

Installation

Via Package Control (recommended! πŸ‘πŸ‘πŸ‘)

Alternatively, clone this repo into your Packages directory. e.g. ~/Library/Application Support/Sublime Text 3/Packages/ on macOS. If you do this you will need to open the Command Palette and run Package Control: Satisfy Dependencies.

Starting Chrome

Chrome needs to be started with a special flag 🏳️ (--remote-debugging-port).

Don't worry, commands are provided to do this for you πŸ˜….

Run them by opening the Command Pallete (macOS: cmd shift P, win/lin: ctrl shift P).

  1. If you haven't opened Chrome, use the Chrome REPL: Start Chrome command.
  2. If Chrome is already running, use Chrome REPL: Restart Chrome with remote debugging*

*this will quit and re-open Chrome, if you want to preserve your tabs, make sure you have set this behaviour in Chrome's settings: On start-up: Continue where you left off.

🚨 Security Warning: New User Profile 🚨

When Chrome restarts, it will use a new Chrome user profile. This is because the Chrome DevTools protocol (that is used for communication) opens a port for communication, but also exposes your cookies. To prevent people on your network from sniffing your important cookies (e.g. website logins), a temporary Chrome user profile is used.

Usage

  1. Start/Restart Chrome as above
  2. Run the Chrome REPL: Connect to Tab command
  3. Select the tab you want to connect to
  4. You should see "Sublime Text connected" in the Chrome Developer Tools console
  5. Use Shift Enter in Sublime Text to execute JavaScript code:
    • If you have nothing selected it will execute the current line
    • With code selected it will execute just the selection

Note: Each Sublime tab can be connected to one Chrome tab. The connected tab is displayed in Sublime in the status bar at the bottom of tab.

Additional commands

  • Clear Console Cmd/Ctrl Shift C
  • Reload Page Cmd/Ctrl Shift R
  • Reload Page (Ignore Cache) Cmd/Ctrl Shift Alt R

Settings

  • πŸ“ Path to Chrome (can be Chrome, Canary, or Chromium)
  • πŸ‘€ Automatically focus on connected Chrome tab (requires wmctrl on Linux)
  • πŸ”§ Automatically opening the Developer Tools for every new window
  • 🏳️ Additional chrome flags
  • ⌨️ Enabling the Command Line API
  • 🏠 Custom hostname and port

Thanks

The project was inspired by SublimeWebInspector, but is far less ambitious, not as opinionated, and thus easier to maintain.

This uses a ever so slightly modified version of PyChromeDevTools, and a stripped down version of Sublime Goto Window.

Known Issues

This plugin relies on psutil. The latest version of psutil requires Python 3.4. This means we are stuck with 5.4.1 which has a known issue on macOS to do with zombie processes. If the only option in the command palette is Restart Chrome then you may need to reboot your machine to clear the issue.

Author

Arthur Carabott - arthurcarabott.com

Buy Me A Coffee

More Repositories

1

audio-dsp-playground

A WebAudioAPI Playground for Audio DSP
JavaScript
131
star
2

tabToWindow

Chrome extension to move the current tab to a new window using the command API
TypeScript
112
star
3

roundhouse-synth-design-course-2014

Introduction to synthesis and SuperCollider course, taught at the Roundhouse, London in January/February 2014
SuperCollider
46
star
4

supercollider-sublime

Sublime Text 3 Package for SuperCollider
Python
17
star
5

GenLoop

A generative looper/loop pedal in SuperCollider.
SuperCollider
17
star
6

musical-user-interfaces

Source for the prototypes in http://arthurcarabott.com/mui/
C++
15
star
7

ohm-konnakkol

parsing konnakol with ohm
JavaScript
14
star
8

livecodeEverything

Code from a live coding remix of Radiohead's "Everything In It's Right Place"
11
star
9

audio-worklet-live-coding

Live code an Audio Worklet in your browser!
JavaScript
10
star
10

faust-by-example

My notes from when first learning Faust faust.grame.fr
9
star
11

selection-history

A UI experiment in visualsing the selection history, designed for tasks that require complex selections e.g. video editing, audio production, graphic design.
TypeScript
8
star
12

piano-roll-layers

A prototype interface for inputting fancier rhythms on a piano roll
JavaScript
7
star
13

chessMusic

Sonification of Chess games in SuperCollider
SuperCollider
6
star
14

audio2midi

Converting audio features to MIDI data
SuperCollider
5
star
15

supercollider-tutorial

Materials for SuperCollider workshop at Resonate '15
SuperCollider
5
star
16

india_tools

Tools written to aide learning of Carnatic Indian music
SuperCollider
4
star
17

poly

Polyrhythm Generator in SuperCollider
SuperCollider
4
star
18

karnatak-rhythms

SuperCollider code from my 2009 undergraduate dissertation "Computer Representation and Generation of Karnatak/Carnatic Rhythms"
SuperCollider
4
star
19

boom-membrane

GUI for SuperCollider Membrane Physical Model by Alex McLean. Membrane source available from (http://yaxu.org/software/)
SuperCollider
4
star
20

algcomp-svarocisa

An algorithmic composition for Kanjira and Electric Guitar in SuperCollider
SuperCollider
4
star
21

natteredMoons

A software instrument in SuperCollider inspired by the theremin and Ondes Martenot
3
star
22

bela-looper

C++
3
star
23

unity-arduino

Example of using an Arduino to control parameters in Unity
C#
2
star
24

typescript-boilerplate

Minimal TypeScript boilerplate project without bundling
JavaScript
2
star
25

visible-light-communication

Experiments with visible light communication
Arduino
2
star
26

sublime-openFrameworks

openFrameworks package for Sublime Text 3
1
star
27

lyrebird

learning music by ear
JavaScript
1
star
28

waveforms-webgl

experiments with waveform rendering in webgl
1
star
29

javascript.flickrshow

JavaScript
1
star
30

genloop2

1
star
31

lowGradeDSP

Some experiments with creating DSP FX via sample level manipulation in SuperCollider
1
star
32

bstore

SuperCollider
1
star
33

can-touch-fixed-distance

TypeScript
1
star
34

pyramidi

Scala
1
star
35

sicktoolbox

fork of the sick toolbox http://sicktoolbox.sourceforge.net/ with patches for the LD series and OS X
C++
1
star
36

real-time-3d-graphics-with-webgl2

Exercises from Real-Time 3D Graphics with WebGL 2 (2nd ed) by Farhad Ghayour and Diego Cantor
TypeScript
1
star
37

warp-x-tate

Scala
1
star