Closed Bug 1533144 Opened 7 months ago Closed 5 months ago

Include hostname from parent/window in HAR save default filename

Categories

(DevTools :: Netmonitor, enhancement, P3)

65 Branch
enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: 13hurdw, Assigned: lloanalas)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

Firefox 65.0.1 macOS

Save all as HAR on network capture

Actual results:

HAR file is named as "Archive [time].har"

Expected results:

Include the name of the window/parent hostname in the save HAR filename, e.g. if on mozilla.org, would download as "mozilla.org_Archive [time].har"

hostname is important part of identifying the HAR capture, would be nice to automatically have it in filename so user doesn't have to keep manually adding the hostname.

Thanks for the report!

Agree, this sounds like nice enhancement.

Honza

Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #1)

Thanks for the report!

Agree, this sounds like nice enhancement.

Honza

If this is something you think I can do, I'd love to try working on it. Doesn't seem overly complicated, it will let me get familiar with another aspect of the Netmonitor project and seems like a useful feature.

Thanks!

Flags: needinfo?(odvarko)

Yes, I think you can do it. Some comments:

  1. Here is the place where the default name is generated

https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/devtools/client/netmonitor/src/har/har-exporter.js#102

  1. We are also having a pref with default file name format:
    https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/devtools/client/netmonitor/src/har/har-exporter.js#67

The default value is: Archive %date

  1. We could introduce a new placeholder: %hostname and fill it in if it's in the default string

We should also have a test for it.

Honza

Assignee: nobody → lloanalas
Status: NEW → ASSIGNED
Flags: needinfo?(odvarko)

Just completed another bug so will start working on this one - thanks Honza!

Include the name of the window/parent hostname in the save HAR filename, e.g. if on mozilla.org, would download as "mozilla.org_Archive [time].har"

It outputs the correct file name now, but I do have a question regarding creating a test for this. Is there a specific way to approach mimicking the har build process - wonder if I'm over thinking it. Thanks!

Flags: needinfo?(odvarko)
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0afabdb9bf04
Include hostname from parent/window in HAR save default filename. r=Honza
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Flags: needinfo?(odvarko)
You need to log in before you can comment on or make changes to this bug.