@@ -133,7 +133,7 @@ const NetworkMonitor = Class(
133
133
}
134
134
} ,
135
135
136
- exportCollectedData : function ( collector ) {
136
+ exportCollectedData : function ( collector , fileName ) {
137
137
Trace . sysout ( "NetworkMonitor.exportCollectedData;" , collector ) ;
138
138
139
139
let toFile = Options . get ( "netexport.autoExportToFile" ) ;
@@ -152,7 +152,7 @@ const NetworkMonitor = Class(
152
152
153
153
// Store collected data into a HAR file (into the default directory).
154
154
if ( toFile ) {
155
- this . exportToFile ( context , jsonString , jsonp ) ;
155
+ this . exportToFile ( context , jsonString , jsonp , fileName ) ;
156
156
}
157
157
158
158
// Send collected data to the server.
@@ -161,7 +161,7 @@ const NetworkMonitor = Class(
161
161
}
162
162
} ,
163
163
164
- exportToFile : makeInfallible ( function ( context , jsonString , jsonp ) {
164
+ exportToFile : makeInfallible ( function ( context , jsonString , jsonp , fileNameFromContent ) {
165
165
var file = ExportUtils . getDefaultFolder ( ) ;
166
166
var now = new Date ( ) ;
167
167
@@ -195,6 +195,10 @@ const NetworkMonitor = Class(
195
195
fileName = name ;
196
196
}
197
197
198
+ if ( fileNameFromContent ) {
199
+ fileName = fileNameFromContent ;
200
+ }
201
+
198
202
// Default file extension is zip if compressing is on
199
203
let fileExt = jsonp ? ".harp" : ".har" ;
200
204
if ( Options . get ( "netexport.compress" ) ) {
@@ -223,9 +227,9 @@ const NetworkMonitor = Class(
223
227
* requests. This is used by the content 'NetExport' driver.
224
228
* (see NetExport.triggerExport)
225
229
*/
226
- triggerExport : function ( ) {
230
+ triggerExport : function ( fileName ) {
227
231
if ( this . harCollector ) {
228
- this . exportCollectedData ( this . harCollector ) ;
232
+ this . exportCollectedData ( this . harCollector , fileName ) ;
229
233
}
230
234
} ,
231
235
0 commit comments