ashley1982 / harviewer

Automatically exported from code.google.com/p/harviewer
0 stars 0 forks source link

API to set the visible columns without using an HTTP cookie #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A minor enhancement request: Starting in 2.0.14, an application that uses 
harviewer can now change the set of hidden columns in the waterfall view by 
setting a cookie. I think it would be good to have an additional API that 
doesn't require cookies.

Original issue reported on code.google.com by bri...@brianp.net on 12 Sep 2011 at 3:31

GoogleCodeExporter commented 9 years ago
I realized that it's actually pretty easy. All you need to do is to modify 
"hiddencols" attribute to specify list of columns (the same format as in case 
of the cookie).

$("#content").bind("onViewerInit", function(event)
{
    event.target.setAttribute("hiddencols", "domain");
});

However, now when I am thinking about this again, I believe I should have done 
the column customization differently. Instead of specifying hidden columns the 
user should specify displayed columns. This way, if new columns are appended to 
the list they stay hidden in case of customized viewer. I think it would be 
better. Sorry about that! 

What do you think?

Honza

Original comment by odva...@gmail.com on 13 Sep 2011 at 10:26

GoogleCodeExporter commented 9 years ago
I agree, specifying the displayed columns instead seems like a good idea to me.

Original comment by bri...@brianp.net on 13 Sep 2011 at 12:40

GoogleCodeExporter commented 9 years ago
R385 - visible columns are specified (instead of hidden)
R386 - API to set the visible columns
R387 - Selenium tests

API example:

$("#content").bind("onViewerInit", function(event)
{
    var viewer = event.target.repObject;

    // Display URL, Status, Size and Timeline columns by default
    // Do not touch cookies (the second parameter is true)
    viewer.setPreviewColumns("url status size timeline", true);
});

Here is an example:
http://code.google.com/p/harviewer/source/browse/trunk/selenium/tests/testCustom
izeColumnsPage2.php

Honza

Original comment by odva...@gmail.com on 18 Sep 2011 at 7:05

GoogleCodeExporter commented 9 years ago
This issue is fixed in HAR Viewer 2.0.15
http://www.softwareishard.com/har/viewer/

Please let me know if it works for you.

Thanks!
Honza

Original comment by odva...@gmail.com on 13 Nov 2011 at 2:34