Skip to content

Commit

Permalink
Merge pull request #224 from matthewmueller/patch-1
Browse files Browse the repository at this point in the history
Easier browser instructions
  • Loading branch information
TooTallNate committed Sep 16, 2015
2 parents fefdae5 + a142c39 commit dc983db
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,13 @@ Then, run the program to be debugged as usual.

## Browser support

Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:
Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`:

```js
window.myDebug = require("debug");
localStorage.debug = 'worker:*'
```

("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:

```js
myDebug.enable("worker:*")
```

Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.
And then refresh the page.

```js
a = debug('worker:a');
Expand Down

0 comments on commit dc983db

Please sign in to comment.