Open Bug 1454725 Opened 7 years ago Updated 11 months ago

HAR file generation fails in Firefox 59.0.2

Categories

(DevTools :: Netmonitor, defect, P4)

59 Branch
defect

Tracking

(Not tracked)

People

(Reporter: czdiaz61, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15

Steps to reproduce:

Hello: I am developing a test with selenium 3.11.0 + geckodriver 0.19.1 + firefox 59.0.2 to get the HAR file when loading a page. I got always an error, and no HAR file when using the latest version of Firefox. I could not find any error in the test configuration, and the logs showed always an error in the javascript har-builder.js, which is internal to Firefox. I have not modified the standard configuration of Firefox, or using any add-ons. The idea is to use an standard configuration. I tested in my Mac High Sierra and in a Ubuntu 16.04. Same results I switched the version to Firefox 57.0, and the tests are now always successful in both the Mac and in the Ubuntu, and the HAR file is generated every time.



Actual results:

I copy the error message from the gecko driver log, as it may help:

console.error: 

 Message: TypeError: requestPostData is undefined
 Stack:
   buildPostData@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-builder.js:268:9
buildRequest@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-builder.js:186:30
buildEntry@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-builder.js:128:27
build@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-builder.js:62:30
buildHarData@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-exporter.js:175:12
fetchHarData@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-exporter.js:140:12
executeExport@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-automation.js:188:12
autoExport@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-automation.js:135:12
pageLoadDone/<@resource://devtools/shared/base-loader.js -> resource://devtools/client/netmonitor/src/har/har-automation.js:116:16



Expected results:

I expect the HAR file to be generated in Firefox 59.0.2 , as it does for Firefox 57.0
Component: Untriaged → Developer Tools: Netmonitor
Sorry for the delay!

There are now WebExtension APIs allowing to trigger export any time and get results back.

See this MDN page:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/devtools.network

Specifically:
* devtools.network.onRequestFinished
* devtools.network.getHAR()

There is also an extension built on top of these APIs allowing to trigger export and get result HAR back using JavaScript from within the page itself.

AMO: https://addons.mozilla.org/en-US/firefox/addon/har-export-trigger/
Source: https://github.com/devtools-html/har-export-trigger

You might also see these threads:
https://github.com/devtools-html/har-export-trigger/issues/13
https://github.com/devtools-html/har-export-trigger/issues/8

The goal is having/maintaining just one code-path for HAR automation (i.e. WebExtension API and supporting extension). Does the API+extension work for you. Is there anything blocking you from using it? I am happy to update the extension and provide what you need!


Honza
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(czdiaz61)
Priority: -- → P4
Product: Firefox → DevTools
Severity: normal → S3

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit BugBot documentation.

Flags: needinfo?(czdiaz61)
You need to log in before you can comment on or make changes to this bug.