Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a constant name for the HAR file #9

Closed
beanqueen opened this issue Oct 10, 2014 · 5 comments
Closed

Set a constant name for the HAR file #9

beanqueen opened this issue Oct 10, 2014 · 5 comments
Assignees

Comments

@beanqueen
Copy link

it would be nice to be able to set the name of the exported file.

if would be even nicer if i were able to issue a command like this:

save_now(under_this_name)

if maybe i wanted to save the requests between two clicks on the same page

thank you!

@yuisong
Copy link

yuisong commented Apr 19, 2015

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

@janodvarko
Copy link
Member

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

  1. You can pass name into NetExport.triggerExport() API

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

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

Honza

@janodvarko janodvarko self-assigned this Apr 21, 2015
@yuisong
Copy link

yuisong commented Apr 22, 2015

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

What's more, it did not show up in https://github.com/firebug/netexport/blob/master/defaults/preferences/prefs.js, either.

Can you have a look at this?

Many thanks!

Yui
2015-04-22 9 18 30

@yuisong
Copy link

yuisong commented Apr 22, 2015

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?

Many thx!

Yui

Here is the Java code:

   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);

@janodvarko
Copy link
Member

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

There is for me, make sure you have Firebug 3 alpha 11 installed (the latest)
http://getfirebug.com/releases/firebug/3.0/
(look in this directory)

What's more, it did not show up in https://github.com/firebug/netexport/blob/master/defaults/preferences/prefs.js, either.

You don't need the NetExport at this point.

Honza

@SebastianZ SebastianZ changed the title Set a constant name for the har file created by net export addon on fire bug Set a constant name for the HAR file Apr 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants