TheBrusMeister / harviewer

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

Open local files through inputUrl ? #101

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Is there a way to open local .har files through url directly ?
I mean for example like this:
http://www.softwareishard.com/har/viewer?inputUrl=D:\demoTest1_chrome.har

Because I have tried and without success (

Original issue reported on code.google.com by tatajaja...@gmail.com on 21 Nov 2014 at 4:18

GoogleCodeExporter commented 8 years ago
See the following example:
http://www.janodvarko.cz/har/viewer/?path=examples/inline-scripts-block.har
Of course the file needs to be available on the server.

If you want to load HAR from different domain you need to use HARP (JSONP)

---

HAR Viewer also supports JSONP and so, it's possible to load log files from 
different domains. This allows linking your online logs and preview them 
automatically within the viewer. See live example.

1. The Content of a *.har file must be enclosed within a callback function:
onInputData({ "log": { ... } })

2. The link displaying a *.har file (using this viewer) must specify URL of the 
file in inputUrl parameter:
http://www.softwareishard.com/har/viewer/?inputUrl=http://www.example.com/netDat
a.har

3. A custom name of the callback function can be specified in a callback 
parameter (by default it's onInputData):
http://www.softwareishard.com/har/viewer/?inputUrl=http://www.example.com/netDat
a.har&callback=onInputData

Original comment by odva...@gmail.com on 24 Nov 2014 at 1:22

GoogleCodeExporter commented 8 years ago
The file is not deployed to web server, it is just locally situated on my 
machine.
Like this: D:\testDemo1.har
This is not a web server path.
I have tried ?path=D:\testDemo1.har and also &callback=onInputData but still 
the same error. Please look to attach file.

Original comment by tatajaja...@gmail.com on 24 Nov 2014 at 2:42

Attachments:

GoogleCodeExporter commented 8 years ago
> I have tried ?path=D:\testDemo1.har and 
You can't use path

> &callback=onInputData but still the same error. Please look to attach file.
Here is a live example:
http://legoas/src/github.com/janodvarko/harviewer/webapp/?inputUrl=http://www.ja
nodvarko.cz/har/viewer/examples/inline-scripts-block.harp

See how the *.harp file looks like 

Original comment by odva...@gmail.com on 24 Nov 2014 at 3:56