cyrus-and / chrome-har-capturer

Capture HAR files from a Chrome instance
MIT License
535 stars 90 forks source link

Fail to load single-resource URLs #2

Closed cyrus-and closed 11 years ago

cyrus-and commented 11 years ago

Singe-resource pages (i.e. just an HTML page, no images, no external CSS... data URIs are resource too) fail to load since in this scenario Chrome emits Page.loadEventFired before the Network.loadingFinished of the page itself and this results (incorrectly) in a pending request.

Reproduce with:

chrome-har-capturer -v http://example.com -o out.har

that gives:

# Connected to Chrome: http://localhost:9222/json
# Connected to WebSocket: ws://localhost:9222/devtools/page/22_1
# --> Page.enable
# --> Network.enable
# --> Network.setCacheDisabled {"cacheDisabled":true}
# --> Page.navigate {"url":"http://example.com"}
# <-- [80.456] Network.requestWillBeSent
# <-- [80.456] Network.requestWillBeSent
# <-- [80.456] Network.requestWillBeSent
# <-- [80.456] Network.responseReceived
# Unhandled message: Page.frameNavigated
# <-- [80.456] Network.dataReceived
# <-- Page.loadEventFired: http://example.com
FAIL http://example.com
# Emitting 'end' event