From 97efd572922893dfcd2f24a18305fc578ccf2d70 Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Wed, 4 Nov 2015 16:48:45 +0100 Subject: [PATCH] #10 experimental support (but platform API needed) --- lib/trigger-toolbox-overlay.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/trigger-toolbox-overlay.js b/lib/trigger-toolbox-overlay.js index d067f48..9c15b6d 100644 --- a/lib/trigger-toolbox-overlay.js +++ b/lib/trigger-toolbox-overlay.js @@ -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 @@ -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 /**