From 86aa7971f0f57702c06bdccd33d2dbd2ecc2b960 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 13 Mar 2024 14:59:41 +0100 Subject: [PATCH] Fix set JS using Bidi (#2103) --- lib/firefox/webdriver/firefox.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/firefox/webdriver/firefox.js b/lib/firefox/webdriver/firefox.js index a9db0bf1a..1a0e811d9 100644 --- a/lib/firefox/webdriver/firefox.js +++ b/lib/firefox/webdriver/firefox.js @@ -10,6 +10,7 @@ import { isAndroidConfigured, Android } from '../../android/index.js'; import { adjustVisualProgressTimestamps } from '../../support/util.js'; import { findFiles } from '../../support/fileUtil.js'; import { GeckoProfiler } from '../geckoProfiler.js'; +import { FirefoxBidi } from '../firefoxBidi.js'; import { MemoryReport } from '../memoryReport.js'; import { PerfStats } from '../perfStats.js'; import { NetworkManager } from '../networkManager.js'; @@ -64,6 +65,13 @@ export class Firefox { } this.bidi = await runner.getDriver().getBidi(); + + this.browsertimeBidi = new FirefoxBidi( + await runner.getDriver().getBidi(), + this.windowId, + runner.getDriver(), + this.options + ); } /** @@ -82,7 +90,7 @@ export class Firefox { */ async beforeStartIteration(runner) { if (this.options.injectJs) { - await this.bidi.injectJavaScript(this.options.injectJs); + await this.browsertimeBidi.injectJavaScript(this.options.injectJs); } if (