Set a constant name for the har file created by net export addon on fire bug

276 views
Skip to first unread message

Angel Veda Raj

unread,
Apr 22, 2014, 7:56:28 AM4/22/14
to fir...@googlegroups.com
Hi, 

I'm using the netExport-0.9b3.xpi addon with firefox to export the network data of my application. I'm using the parameter extensions.firebug.netexport.defaultLogDir to set the default directory where it exports the HAR files. I see that the files are named as localhost-7080+2014-04-22+17-03-47.har (hostname-port+date and time). Is there a way I can give a constant name for this HAR log file and the latest file overwrites the existing one?

Thanks,
Angel.

Jan Honza Odvarko

unread,
Apr 28, 2014, 7:14:26 AM4/28/14
to fir...@googlegroups.com
There is currently no such option, but it should be easy to implement it.

Please file a new issue here:
https://github.com/firebug/netexport/issues

...and I'll take a look at it.

Honza

songy...@gmail.com

unread,
Apr 19, 2015, 4:34:36 AM4/19/15
to fir...@googlegroups.com
Hi, 

I wonder whether there is an option for us to set the name of the exported har file now?

Many thanks,
Yui

在 2014年4月28日星期一 UTC+8下午7:14:26,Jan Honza Odvarko写道:

Jan Honza Odvarko

unread,
Apr 20, 2015, 10:41:27 AM4/20/15
to fir...@googlegroups.com
Yes, it is now possible to provide a custom name.

1) There is a new pref:  extensions.firebug.netexport.defaultFileName
You can set it to a string that is used as a format string for generating the name
An example: myname-%Y-%m-%d-endofthename

Read more about the format:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleFormat

2) You can pass name into NetExport.triggerExport()

NetExport.triggerExport({
  fileName: "myFileName"
})

NetExport is currently bundled in Firebug.next and this new feature is available in alpha 10
https://github.com/firebug/firebug.next/releases/tag/firebug-3.0.0-alpha.10

Honza

songy...@gmail.com

unread,
Apr 21, 2015, 10:49:22 AM4/21/15
to fir...@googlegroups.com

Now I use Selenium + FirefoxWebdriver(FF for mac 37.0.2 ) + Firebug 3. I wrote a Har file generator in Java and take the use of the code on your blog as the following. However, the new pref:  extensions.firebug.netexport.defaultFileName dosen't work. Is there some thing wrong? Or is it necessary for me to use a format as you mention above?


       String url ="www.google.com";    

        // Set default Firefox preferences

        profile.setPreference("app.update.enabled", false);


        String domain = "extensions.firebug.";


        // Set default Firebug preferences

        profile.setPreference(domain + "currentVersion", "3.0.0");

        profile.setPreference(domain + "allPagesActivation", "on");

        profile.setPreference(domain + "defaultPanelName", "net");

        profile.setPreference(domain + "net.enableSites", true);


        // Set default NetExport preferences

        profile.setPreference(domain + "netexport.alwaysEnableAutoExport", true);

        profile.setPreference(domain + "netexport.showPreview", false);

        profile.setPreference(domain + "netexport.defaultLogDir", "~/project/har");

        profile.setPreference(domain + "netexport.defaultFileName", url);// Set the name of the har log file

                   

      //Set up the browser

        WebDriver driver = new FirefoxDriver(profile);

        driver.get(url);


在 2015年4月20日星期一 UTC+8下午10:41:27,Jan Honza Odvarko写道:

songy...@gmail.com

unread,
Apr 21, 2015, 9:32:02 PM4/21/15
to fir...@googlegroups.com

And here is the screenshot of my about:config. There isn't a pref named extensions.firebug.netexport.defaultFileName.


Can you have a look at this?

Many thanks!

Yui



在 2015年4月21日星期二 UTC+8下午10:49:22,songy...@gmail.com写道:

Jan Honza Odvarko

unread,
Apr 22, 2015, 5:58:14 AM4/22/15
to fir...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages