@flowriki/agent 0.1.0-beta.14 → 0.1.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ import os from "os";
|
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { createRequire } from "module";
|
|
8
8
|
import { spawnSync } from "child_process";
|
|
9
|
-
var AGENT_VERSION = "0.1.0-beta.
|
|
9
|
+
var AGENT_VERSION = "0.1.0-beta.15";
|
|
10
10
|
async function prepareBrowsers() {
|
|
11
11
|
if (browsersReady()) {
|
|
12
12
|
return { ok: true, already: true, message: "chromium is already installed" };
|
|
@@ -4780,15 +4780,22 @@ async function startRecordingSession(opts) {
|
|
|
4780
4780
|
const page = await context.newPage();
|
|
4781
4781
|
if (opts.authentication) {
|
|
4782
4782
|
try {
|
|
4783
|
-
|
|
4783
|
+
const runnable = opts.authentication.step.auth ? opts.authentication.resolveAuth(opts.authentication.step.auth) : void 0;
|
|
4784
|
+
if (!runnable || runnable.navigation.kind === "continue") {
|
|
4785
|
+
await page.goto(url, { waitUntil: "domcontentloaded" });
|
|
4786
|
+
}
|
|
4784
4787
|
await executeStep(page, opts.authentication.step, { ...opts.authentication, baseUrl: url });
|
|
4785
4788
|
const resume = { id: "auth-return", type: "navigate", name: "Open recording start page", role: "", scope: "", value: new URL(url).pathname + new URL(url).search + new URL(url).hash, navigationBase: "application", secret: false, legacySelector: "", proposals: [] };
|
|
4786
4789
|
steps.push(opts.authentication.step, resume);
|
|
4787
4790
|
onStep?.(opts.authentication.step);
|
|
4788
4791
|
onStep?.(resume);
|
|
4789
4792
|
} catch (error) {
|
|
4790
|
-
await
|
|
4791
|
-
|
|
4793
|
+
const landed = await page.url().replace(/^https?:\/\/[^/]+/, "");
|
|
4794
|
+
const title = await page.title().catch(() => "");
|
|
4795
|
+
stopped = true;
|
|
4796
|
+
await browser.close().catch(() => {
|
|
4797
|
+
});
|
|
4798
|
+
throw new Error(`${firstLine2(error)} \u2014 the browser was on ${landed || "/"}${title ? ` ("${title}")` : ""}`);
|
|
4792
4799
|
}
|
|
4793
4800
|
}
|
|
4794
4801
|
await context.addInitScript({ content: INIT_SCRIPT });
|
package/dist/cli.js
CHANGED
package/dist/engine.js
CHANGED
package/package.json
CHANGED