Skip to content

Commit

Permalink
#10 experimental support (but platform API needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Nov 4, 2015
1 parent 45f4559 commit 97efd57
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/trigger-toolbox-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const TriggerToolboxOverlay = Class(

// Initialize automation.
harOverlay.initAutomation();
this.patchAutomation(harOverlay.automation);
}

// This is a bit hacky, but the HarAutomation starts monitoring
Expand All @@ -124,6 +125,30 @@ const TriggerToolboxOverlay = Class(
});
},

/**
* xxxHonza: this needs better platform API.
* See also: https://github.com/firebug/har-export-trigger/issues/10
*/
patchAutomation: function(automation){
let self = this;
automation.pageLoadDone = function(response) {
Trace.sysout("HarAutomation.patchAutomation;", response);

if (this.collector) {
this.collector.waitForHarLoad().then(collector => {
self.onPageLoadDone(response);
return this.autoExport();
});
}
}
},

onPageLoadDone: function(response) {
Trace.sysout("TriggerToolboxOverlay.onPageLoadDone;", response);

this.front.pageLoadDone();
},

// Backend

/**
Expand Down

0 comments on commit 97efd57

Please sign in to comment.