har-export-trigger icon indicating copy to clipboard operation
har-export-trigger copied to clipboard

Resulting HAR does not conform to spec

Open sciatro opened this issue 6 years ago • 0 comments

The HAR returned by v0.6.1 of the plugin on FF v68 does not conform to v1.2 of the HAR spec.

I've noticed two issues that cause the return value of HAR.triggerExport() to fail validation:

The Apache 2 Licensed Browsertime project includes a function which brings the plugin return value into conformity, partially reproduced here:

  HAR.triggerExport()
    .then((result) => {
      // Different handling in FF 60 and 61 :|
      if (result.log) {
        result.log.pages[0].title = document.URL;
      }
      else {
        result.pages[0].title = document.URL;
      }
      // Normalize
      return callback({'har': result.log ? result: {log: result}});
  })

sciatro avatar Aug 07 '19 14:08 sciatro