Hi,

Can a combination of Firebug and NetExport be used to save binary data in a 
HAR file?

I am not familiar with the source code of either so I could be heading in 
the wrong direction, but I have taken a look, and the following code seems 
to try and convert every response into Unicode.

https://github.com/firebug/firebug/blob/58c5de64c21759dc66d3d762c45942a3448cb2be/extension/content/firebug/net/tabCache.js#L336

Is this correct for non-text data?

Using this PNG file, 
http://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Mozilla_Firefox_logo_2013.svg/40px-Mozilla_Firefox_logo_2013.svg.png,
 
in the following HTML:

<!doctype html>

<body>

<img src="Mozilla_Firefox_logo_2013.svg.png">

</body>

the response gets converted and I can't seem to get the original image data 
back.

I have attached a HAR as an example.

The first 4 bytes of a PNG should be [0x89, 'P', 'N', 'G'], or [89 50 4E 
47], but the exported HAR has content "‰PNG" in the HAR file, which is [E2 
80 B0 50 4E 47].  I have not been able to transform this encoded string 
representation back to the original bytes.  Maybe an encoding issue?

It seems as though 0x89 in Windows CP1252 is the same double-percent 
character, so could this have something to do with it?  In which case, do I 
need to know the platform's default encoding to map UTF8 characters back to 
platform encoded characters in order to retrieve the image data? 
(http://effbot.org/zone/unicode-gremlins.htm)

Chrome seems to use base64 to export the same image when saving as HAR from 
Chrome.  Would this be a safer option all round?

Thanks for any help,

Paul.

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/firebug/ab214e42-320c-4843-a653-55ccd79133d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: localhost-8080.har
Description: Binary data

Reply via email to