diff --git a/lib/core/engine/command/geckoProfiler.js b/lib/core/engine/command/geckoProfiler.js index 79eba9b64..b10ad03e1 100644 --- a/lib/core/engine/command/geckoProfiler.js +++ b/lib/core/engine/command/geckoProfiler.js @@ -1,11 +1,12 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.geckoprofiler'); export class GeckoProfiler { - constructor(GeckoProfiler, browser, index, options) { + constructor(GeckoProfiler, browser, index, options, result) { this.GeckoProfiler = GeckoProfiler; this.browser = browser; this.index = index; this.options = options; + this.result = result; } async start() { @@ -25,11 +26,7 @@ export class GeckoProfiler { async stop() { if (this.options.browser === 'firefox') { if (this.options.firefox.geckoProfilerRecordingType === 'custom') { - const url = await this.browser - .getDriver() - .executeScript('return document.documentURI;'); - - return this.GeckoProfiler.stop(this.index, url); + return this.GeckoProfiler.stop(this.index, this.result[0].url); } } else { throw new Error('Geckoprofiler only works in Firefox'); diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 72dc50222..6aed77ad7 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -159,7 +159,8 @@ export class Iteration { browserProfiler, browser, index, - this.options + this.options, + result ); const cdp = new ChromeDevelopmentToolsProtocol( engineDelegate,