Skip to content

Commit 97efd57

Browse files
committed
#10 experimental support (but platform API needed)
1 parent 45f4559 commit 97efd57

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/trigger-toolbox-overlay.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const TriggerToolboxOverlay = Class(
9999

100100
// Initialize automation.
101101
harOverlay.initAutomation();
102+
this.patchAutomation(harOverlay.automation);
102103
}
103104

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

128+
/**
129+
* xxxHonza: this needs better platform API.
130+
* See also: https://github.com/firebug/har-export-trigger/issues/10
131+
*/
132+
patchAutomation: function(automation){
133+
let self = this;
134+
automation.pageLoadDone = function(response) {
135+
Trace.sysout("HarAutomation.patchAutomation;", response);
136+
137+
if (this.collector) {
138+
this.collector.waitForHarLoad().then(collector => {
139+
self.onPageLoadDone(response);
140+
return this.autoExport();
141+
});
142+
}
143+
}
144+
},
145+
146+
onPageLoadDone: function(response) {
147+
Trace.sysout("TriggerToolboxOverlay.onPageLoadDone;", response);
148+
149+
this.front.pageLoadDone();
150+
},
151+
127152
// Backend
128153

129154
/**

0 commit comments

Comments
 (0)