Skip to content

Commit

Permalink
Add more clear instruction on how to add keyboard shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 8, 2012
1 parent b2f7777 commit dba8fcb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion readme.md
Expand Up @@ -12,10 +12,24 @@ Install with [Package Control](http://wbond.net/sublime_packages/package_control

Select some code or just highlight a line and choose "Run JavaScript in the browser" in the Command Palette *(Cmd+Shift+P)*. This will then run the command in the active tab in the frontmost browser window. Switch to the browser window to see the result, and optionally open the Console (Dev Tools) to see console.log output.


### Options

Set your preferred browser in the settings: `chrome` (default), `chrome_canary`, `safari`, `opera`
(Preferences > Package Settings > JsRun > Settings - User)

You can also set up a keyboard shortcut to run the command by opening up "Preferences > Key Bindings - User" and adding your shortcut with the command `js_run`.

### Keyboard shortcut

You can also set up a keyboard shortcut to run the command by opening up "Preferences > Key Bindings - User" and adding:

```json
[
{ "keys": ["ctrl+shift+j"], "command": "js_run" }
]
```

### Supported browsers

Currently supports Chrome, Chrome Canary, Safari and Opera on OS X. Firefox doesn't [expose JS to AppleScript](https://bugzilla.mozilla.org/show_bug.cgi?id=5704).

Expand Down

0 comments on commit dba8fcb

Please sign in to comment.