agusantoso / harviewer

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

Relies on hard-coded #content div #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I'm looking at integrating harviewer within a Drupal module. Most Drupal themes 
have a #content div that is used to show the main page content, which makes 
HarViewer incompatible given it's trying to take over the entire div.

What is the expected output?
I'd expect to be able to initialize HarViewer myself against any page element.

What do you see instead?
Appears to look for #content and nothing else.

Original issue reported on code.google.com by catc...@gmail.com on 21 Nov 2012 at 10:10

GoogleCodeExporter commented 9 years ago
The piece that is responsible for HarViewer initialization and also the piece 
which is referring the "content" element is here:

https://github.com/janodvarko/harviewer/blob/master/webapp/scripts/harViewer.js#
L189
(note that the source is maintained on github.com now)

and for HarPreview here:

https://github.com/janodvarko/harviewer/blob/master/webapp/scripts/harPreview.js
#L90

You can also see APIs that are used to customize the HarViewer:
http://code.google.com/p/harviewer/wiki/API

Any specific requirements for how the API (allowing to initialize HarViewer 
against any page element) should look like?

Btw. what is the reason why not to insert the entire viewer into an iframe?

Honza

Original comment by odva...@gmail.com on 22 Nov 2012 at 9:21

GoogleCodeExporter commented 9 years ago
I don't really have specific requirements, would just like to avoid the 
conflict. Looking for an id with less chance of conflicts like #harviewer would 
also help. Although having it more flexible would also allow for multiple 
instances per page no?

https://github.com/s3u/har-view appears to allow for this, for example. 
Something along those lines would be plenty.

For the iframe, I'm storing HAR in a database, loading them raw onto a page 
then would like to process them with harviewer - but still have the raw json 
available for those that want to read it raw etc.. An iframe would be a fair 
bit of overhead for this.

Original comment by catc...@gmail.com on 22 Nov 2012 at 12:15