Skip to content

Commit dc983db

Browse files
committed
Merge pull request #224 from matthewmueller/patch-1
Easier browser instructions
2 parents fefdae5 + a142c39 commit dc983db

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Readme.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,13 @@ Then, run the program to be debugged as usual.
8383

8484
## Browser support
8585

86-
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:
86+
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`:
8787

8888
```js
89-
window.myDebug = require("debug");
89+
localStorage.debug = 'worker:*'
9090
```
9191

92-
("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:
93-
94-
```js
95-
myDebug.enable("worker:*")
96-
```
97-
98-
Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.
92+
And then refresh the page.
9993

10094
```js
10195
a = debug('worker:a');

0 commit comments

Comments
 (0)