@@ -64,7 +64,7 @@ export class Request {
64
64
this . _resourceType = "Other" ;
65
65
return ;
66
66
}
67
-
67
+
68
68
this . _mimeType = value ;
69
69
70
70
var resourceType = "Other" ;
@@ -112,19 +112,19 @@ export class Request {
112
112
this . _resourceType = value ;
113
113
}
114
114
}
115
-
115
+
116
116
public responseReceived ( response : inspectorCommandTypes . NetworkDomain . Response ) : void {
117
117
if ( this . _networkDomainDebugger . enabled ) {
118
118
this . _networkDomainDebugger . events . responseReceived ( this . requestID , frameId , loaderId , __inspectorTimestamp ( ) , < any > this . resourceType , response ) ;
119
119
}
120
120
}
121
-
121
+
122
122
public loadingFinished ( ) : void {
123
123
if ( this . _networkDomainDebugger . enabled ) {
124
124
this . _networkDomainDebugger . events . loadingFinished ( this . requestID , __inspectorTimestamp ( ) ) ;
125
125
}
126
126
}
127
-
127
+
128
128
public requestWillBeSent ( request : inspectorCommandTypes . NetworkDomain . Request ) : void {
129
129
if ( this . _networkDomainDebugger . enabled ) {
130
130
this . _networkDomainDebugger . events . requestWillBeSent ( this . requestID , frameId , loaderId , request . url , request , __inspectorTimestamp ( ) , { type : "Script" } ) ;
@@ -136,9 +136,13 @@ export class Request {
136
136
export class NetworkDomainDebugger implements inspectorCommandTypes . NetworkDomain . NetworkDomainDispatcher {
137
137
private _enabled : boolean ;
138
138
public events : inspectorCommandTypes . NetworkDomain . NetworkFrontend ;
139
-
139
+
140
140
constructor ( ) {
141
141
this . events = new inspectorCommands . NetworkDomain . NetworkFrontend ( ) ;
142
+
143
+ // By default start enabled because we can miss the "enable" event when
144
+ // running with `--debug-brk` -- the frontend will send it before we've been created
145
+ this . enable ( ) ;
142
146
}
143
147
144
148
get enabled ( ) : boolean {
@@ -156,7 +160,7 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
156
160
}
157
161
this . _enabled = true ;
158
162
}
159
-
163
+
160
164
/**
161
165
* Disables network tracking, prevents network events from being sent to the client.
162
166
*/
@@ -166,14 +170,14 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
166
170
}
167
171
this . _enabled = false ;
168
172
}
169
-
173
+
170
174
/**
171
175
* Specifies whether to always send extra HTTP headers with the requests from this page.
172
176
*/
173
177
setExtraHTTPHeaders ( params : inspectorCommandTypes . NetworkDomain . SetExtraHTTPHeadersMethodArguments ) : void {
174
178
//
175
179
}
176
-
180
+
177
181
/**
178
182
* Returns content served for the given request.
179
183
*/
@@ -187,9 +191,9 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
187
191
body : body ,
188
192
base64Encoded : ! resource_data . hasTextContent
189
193
} ;
190
- }
194
+ }
191
195
}
192
-
196
+
193
197
/**
194
198
* Tells whether clearing browser cache is supported.
195
199
*/
@@ -198,14 +202,14 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
198
202
result : false
199
203
} ;
200
204
}
201
-
205
+
202
206
/**
203
207
* Clears browser cache.
204
208
*/
205
209
clearBrowserCache ( ) : void {
206
210
//
207
211
}
208
-
212
+
209
213
/**
210
214
* Tells whether clearing browser cookies is supported.
211
215
*/
@@ -214,21 +218,21 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
214
218
result : false
215
219
} ;
216
220
}
217
-
221
+
218
222
/**
219
223
* Clears browser cookies.
220
224
*/
221
225
clearBrowserCookies ( ) : void {
222
226
//
223
227
}
224
-
228
+
225
229
/**
226
230
* Toggles ignoring cache for each request. If <code>true</code>, cache will not be used.
227
231
*/
228
232
setCacheDisabled ( params : inspectorCommandTypes . NetworkDomain . SetCacheDisabledMethodArguments ) : void {
229
233
//
230
234
}
231
-
235
+
232
236
/**
233
237
* Loads a resource in the context of a frame on the inspected page without cross origin checks.
234
238
*/
@@ -245,7 +249,7 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
245
249
status : 200
246
250
}
247
251
}
248
-
252
+
249
253
public static idSequence : number = 0 ;
250
254
create ( ) : Request {
251
255
let id = ( ++ NetworkDomainDebugger . idSequence ) . toString ( ) ;
@@ -264,4 +268,4 @@ export class RuntimeDomainDebugger {
264
268
compileScript ( ) : { scriptId ?: string , exceptionDetails ?: Object } {
265
269
return { } ;
266
270
}
267
- }
271
+ }
0 commit comments