mozilla / lightbeam

Orignal unmaintained version of the Lightbeam extension. See lightbeam-we for the new one which works in modern versions of Firefox.
https://github.com/mozilla/lightbeam-we
Mozilla Public License 2.0
586 stars 149 forks source link

Update File Format with information on lightbeamData.json structure. #710

Open aral opened 8 years ago

aral commented 8 years ago

Looking at https://github.com/mozilla/lightbeam/blob/master/doc/data_format.v1.2.md, it’s difficult to understand the output of the “Save Data” feature (lightbeamData.json).

After some searching, I found the data structure in https://github.com/mozilla/lightbeam/blob/master/lib/connection.js#L278:

    this.source,
    this.target,
    this.timestamp.valueOf(),
    this.contentType,
    this.cookie,
    this.sourceVisited,
    this.secure,
    this.sourcePathDepth,
    this.sourceQueryDepth,
    this.sourceSub,
    this.targetSub,
    this.method,
    this.status,
    this.cacheable,
    this._sourceTab.isPrivate

So, based on this, it would be helpful to have something like the following in the docs:

The lightbeamData.json file that is produced by the Save Data button is an array of connection objects and has the following structure:

[
  [
    source (string),
    target (string),
    timestamp (number),
    contentType (string),
    cookie (bool),
    sourceVisited (boolean),
    secure (boolean),
    sourcePathDepth (number),
    sourceQueryDepth (number),
    sourceSubdomain (number),
    targetSubdomain (number),
    method,
    statusCode (number),
    cacheable (boolean),
    privateTab (boolean)
  ],
…
]

That would have saved me a bit of time. Please let me know if you’d like me to submit this as a pull request (wanted to bring it up for discussion first in case anyone has better ideas for documenting it or if I missed some existing documentation somewhere). Thanks!

fmarier commented 8 years ago

Please let me know if you’d like me to submit this as a pull request (wanted to bring it up for discussion first in case anyone has better ideas for documenting it or if I missed some existing documentation somewhere).

Sounds like a great idea @aral. That should go wherever you looked when you couldn't find it :)