Skip to content

Commit b68b89f

Browse files
authored
Switch back to tcp (firefox-devtools#7963)
1 parent d4d84f4 commit b68b89f

File tree

5 files changed

+39
-87
lines changed

5 files changed

+39
-87
lines changed

bin/getConfig.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fs = require("fs");
33
const path = require("path");
44

55
function getConfig() {
6-
const applicationConfig = require("../configs/application.json");
76
const firefoxConfig = require("../configs/firefox-panel.json");
87
const developmentConfig = require("../configs/development.json");
98

@@ -16,10 +15,7 @@ function getConfig() {
1615
return firefoxConfig;
1716
}
1817

19-
const envConfig = process.env.TARGET === "application" ?
20-
applicationConfig : developmentConfig;
21-
22-
return merge({}, envConfig, localConfig);
18+
return merge({}, developmentConfig, localConfig);
2319
}
2420

2521
module.exports = getConfig;

configs/application.json

-39
This file was deleted.

configs/development.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"port": 9229
2020
},
2121
"firefox": {
22-
"webSocketConnection": true,
22+
"webSocketConnection": false,
2323
"host": "localhost",
2424
"webSocketPort": 8116,
2525
"tcpPort": 6080,

configs/local.sample.json

+2-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
{
22
"theme": "light",
3-
"hotReloading": false,
4-
"logging": {
5-
"actions": false
6-
},
7-
"performance": {
8-
"actions": false
9-
},
10-
"features": {
11-
"eventListeners": {
12-
"label": "Event Listeners",
13-
"enabled": false
14-
},
15-
"codeCoverage": {
16-
"label": "Code Coverage",
17-
"enabled": false
18-
},
19-
"codeFolding": {
20-
"label": "Code Folding",
21-
"enabled": false
22-
},
23-
"searchNav": {
24-
"label": "Search Navigation",
25-
"enabled": false
26-
}
3+
"firefox": {
4+
"webSocketConnection": false
275
}
286
}

docs/getting-setup.md

+35-18
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You can download the latest versions [here][node].
1111
```bash
1212
npm i -g yarn
1313
```
14+
1415
**Why Yarn and not NPM?**
1516

1617
NPM installs the latest versions. We use [Yarn][yarn] because we want to make sure everyone is using the same libraries.
@@ -89,6 +90,7 @@ If you're looking for an alternative to opening Firefox from inside the debugger
8990
**Firefox CLI**
9091

9192
1. Run `firefox-bin` from the command line.
93+
9294
```bash
9395
/Applications/Firefox.app/Contents/MacOS/firefox-bin --start-debugger-server 6080 -P development
9496
```
@@ -97,12 +99,26 @@ You'll be prompted to create a new "development profile". The development profil
9799

98100
2. Navigate to `about:config` and accept any warning messages. Then, search for the following preferences, and double-click them to toggle their values according to [this example](http://g.recordit.co/3VsHIooZ9q.gif):
99101

100-
* `devtools.debugger.remote-enabled` to `true`
101-
* `devtools.chrome.enabled` to `true`
102-
* `devtools.debugger.prompt-connection` to `false`
102+
- `devtools.debugger.remote-enabled` to `true`
103+
- `devtools.chrome.enabled` to `true`
104+
- `devtools.debugger.prompt-connection` to `false`
103105

104106
3. Restart Firefox by closing and reopening it with the `firefox-bin` command.
105107

108+
#### Using Web Sockets
109+
110+
If you are not seeing any tabs when you connect, it is possible that switching from a TCP server to a WS could help.
111+
112+
1. create a `local.json` file in `configs` and set `firefox.webSocketConnection` to `true`
113+
2. Start Firefox from the command line
114+
115+
```
116+
/Applications/Firefox\ Nightly.app/Contents/MacOS/firefox --start-debugger-server ws:8116 -P dev
117+
```
118+
119+
> NOTE: if you are curious about how the debugger server starts listening on a port
120+
> this function is useful: [devtools-startup.js](https://searchfox.org/mozilla-central/source/devtools/startup/devtools-startup.js#789-854)
121+
106122
### Starting Chrome
107123

108124
There are two ways to run Chrome for the purposes of remote debugging with the debugger:
@@ -123,36 +139,37 @@ And the slightly harder way:
123139

124140
It's easy to start Node in a mode where DevTools will find it:
125141

126-
* *--inspect* - tells Node to open a debugger server.
127-
* *--inspect=9223* - tells Node to open a debugger server on 9223 instead of 9229.
128-
* *--debug-brk* - tells Node to pause on the first statement.
142+
- _--inspect_ - tells Node to open a debugger server.
143+
- _--inspect=9223_ - tells Node to open a debugger server on 9223 instead of 9229.
144+
- _--debug-brk_ - tells Node to pause on the first statement.
129145

130146
```bash
131147
node --inspect --debug-brk ./node_modules/.bin/webpack
132148
```
133149

134-
**Note:** *./node_modules/.bin/webpack* could be anything. We're often debugging Webpack these days, so it's often appropriate.
150+
**Note:** _./node_modules/.bin/webpack_ could be anything. We're often debugging Webpack these days, so it's often appropriate.
135151

136152
**Note:** Currently, Node.js debugging is limited in some ways. For example, there isn't support for seeing variables or the console, but you can manage breakpoints and navigate code execution (pause, step-in, step-over, etc.) in the debugger across various sources.
137153

138154
### Windows + Linux Setup
139155

140-
Windows and Linux should *just work* most of the time. However, there are several edge cases.
156+
Windows and Linux should _just work_ most of the time. However, there are several edge cases.
141157

142158
If you find any issues on these two platforms, please leave a comment on these issues:
143-
* [Windows][windows-issue]
144-
* [Linux][linux-issue]
159+
160+
- [Windows][windows-issue]
161+
- [Linux][linux-issue]
145162

146163
**Firefox Windows Command**
164+
147165
```
148166
C:\Program Files (x86)\Mozilla Firefox\firefox.exe -start-debugger-server 6080 -P development
149167
```
150168

151-
[debugger-intro-gif]:http://g.recordit.co/WjHZaXKifZ.gif
152-
[done-screenshot]:https://cloud.githubusercontent.com/assets/254562/20439409/55e3994a-ad89-11e6-8e76-55e18c7c0d75.png
153-
154-
[linux-issue]:https://github.com/firefox-devtools/debugger.html/issues/1082
155-
[windows-issue]:https://github.com/firefox-devtools/debugger.html/issues/1248
156-
[yarn-issue]:https://github.com/firefox-devtools/debugger.html/issues/1216
157-
[yarn]:https://yarnpkg.com
158-
[node]:https://nodejs.org/
169+
[debugger-intro-gif]: http://g.recordit.co/WjHZaXKifZ.gif
170+
[done-screenshot]: https://cloud.githubusercontent.com/assets/254562/20439409/55e3994a-ad89-11e6-8e76-55e18c7c0d75.png
171+
[linux-issue]: https://github.com/firefox-devtools/debugger.html/issues/1082
172+
[windows-issue]: https://github.com/firefox-devtools/debugger.html/issues/1248
173+
[yarn-issue]: https://github.com/firefox-devtools/debugger.html/issues/1216
174+
[yarn]: https://yarnpkg.com
175+
[node]: https://nodejs.org/

0 commit comments

Comments
 (0)