@intuned/runtime-dev 1.3.22-dev.5 → 1.3.22-dev.7
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.
|
@@ -7,7 +7,7 @@ export interface Proxy {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Get ignore_http_errors setting from CLI option or environment variable.
|
|
10
|
-
* Priority: cliOption > environment variable > false
|
|
10
|
+
* Priority: cliOption(true only) > environment variable > false
|
|
11
11
|
*/
|
|
12
12
|
export declare function getIgnoreHttpErrorsFromConfig(cliOption?: boolean): Promise<boolean>;
|
|
13
13
|
export type LaunchBrowserResult = {
|
|
@@ -27,7 +27,6 @@ export type LaunchChromiumStandaloneOptions = {
|
|
|
27
27
|
export type LaunchChromiumCdpOptions = {
|
|
28
28
|
cdpAddress: string;
|
|
29
29
|
cdpTargetId?: string;
|
|
30
|
-
ignoreHttpErrors?: boolean;
|
|
31
30
|
timeout?: number;
|
|
32
31
|
};
|
|
33
32
|
export declare function launchChromium(options: LaunchChromiumStandaloneOptions): Promise<LaunchBrowserResult>;
|
|
@@ -50,22 +50,17 @@ async function createUserDirWithPreferences() {
|
|
|
50
50
|
return userDir;
|
|
51
51
|
}
|
|
52
52
|
async function getIgnoreHttpErrorsFromConfig(cliOption) {
|
|
53
|
-
if (cliOption
|
|
54
|
-
|
|
55
|
-
return cliOption;
|
|
53
|
+
if (cliOption === true) {
|
|
54
|
+
return true;
|
|
56
55
|
}
|
|
57
56
|
const envValue = process.env.INTUNED_PLAYWRIGHT_CONTEXT_IGNORE_HTTP_ERRORS;
|
|
58
57
|
if (envValue !== undefined) {
|
|
59
|
-
|
|
60
|
-
console.log(`[ignore_http_errors] using env value: ${parsedValue}`);
|
|
61
|
-
return parsedValue;
|
|
58
|
+
return envValue.toLowerCase() === "true" || envValue === "1" || envValue.toLowerCase() === "yes";
|
|
62
59
|
}
|
|
63
|
-
console.log("[ignore_http_errors] env not set, using default: false");
|
|
64
60
|
return false;
|
|
65
61
|
}
|
|
66
62
|
async function launchChromium(options) {
|
|
67
63
|
if ("cdpAddress" in options) {
|
|
68
|
-
console.log(`[ignore_http_errors] launchChromium (cdp) received value: ${options.ignoreHttpErrors}`);
|
|
69
64
|
if (await (0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
70
65
|
await (0, _intunedExtensionServer.setupIntunedExtensionServer)();
|
|
71
66
|
}
|
|
@@ -112,7 +107,6 @@ async function launchChromium(options) {
|
|
|
112
107
|
executablePath
|
|
113
108
|
} = options;
|
|
114
109
|
const ignoreHttpErrors = await getIgnoreHttpErrorsFromConfig(ignoreHttpErrorsParam);
|
|
115
|
-
console.log(`[ignore_http_errors] launchChromium resolved value: ${ignoreHttpErrors}`);
|
|
116
110
|
const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
|
|
117
111
|
const extraArgs = [];
|
|
118
112
|
const macKeychainBypassArgs = getMacKeychainBypassArgs();
|
|
@@ -22,7 +22,6 @@ export declare function withPlaywrightContext<R>(options: {
|
|
|
22
22
|
export declare function withPlaywrightContext<R>(options: {
|
|
23
23
|
cdpAddress: string;
|
|
24
24
|
cdpTargetId?: string;
|
|
25
|
-
ignoreHttpErrors?: boolean;
|
|
26
25
|
} & WithPlaywrightContextParameters, fn: WithPlaywrightContextWrappedFunction<R>): Promise<Ok<R, any> | Err<any, RunAutomationError>>;
|
|
27
26
|
export declare function loadSessionToContext({ context, session, }: {
|
|
28
27
|
context: playwright.BrowserContext;
|
|
@@ -43,8 +43,7 @@ async function withPlaywrightContext({
|
|
|
43
43
|
context
|
|
44
44
|
} = await (0, _launchBrowser.launchBrowser)({
|
|
45
45
|
cdpAddress,
|
|
46
|
-
cdpTargetId
|
|
47
|
-
ignoreHttpErrors
|
|
46
|
+
cdpTargetId
|
|
48
47
|
}));
|
|
49
48
|
} else {
|
|
50
49
|
({
|
|
@@ -67,8 +66,7 @@ async function withPlaywrightContext({
|
|
|
67
66
|
page
|
|
68
67
|
} = await (0, _launchBrowser.launchBrowser)({
|
|
69
68
|
cdpAddress,
|
|
70
|
-
cdpTargetId
|
|
71
|
-
ignoreHttpErrors
|
|
69
|
+
cdpTargetId
|
|
72
70
|
}));
|
|
73
71
|
} else {
|
|
74
72
|
const port = await (0, _portfinder.getPort)({
|
|
@@ -157,7 +157,6 @@ async function runApi({
|
|
|
157
157
|
return await (0, _playwrightContext.withPlaywrightContext)({
|
|
158
158
|
cdpAddress: runOptions.cdpAddress,
|
|
159
159
|
cdpTargetId: runOptions.cdpTargetId,
|
|
160
|
-
ignoreHttpErrors: runOptions.ignoreHttpErrors,
|
|
161
160
|
...playwrightContextParameters
|
|
162
161
|
}, runAutomationWithContext);
|
|
163
162
|
}
|
|
@@ -228,8 +228,7 @@ var require_types = __commonJS({
|
|
|
228
228
|
exports2.runApiCdpRunOptionsSchema = zod_1.default.object({
|
|
229
229
|
environment: zod_1.default.literal("cdp"),
|
|
230
230
|
cdpAddress: zod_1.default.string(),
|
|
231
|
-
cdpTargetId: zod_1.default.string().optional()
|
|
232
|
-
ignoreHttpErrors: zod_1.default.boolean().optional()
|
|
231
|
+
cdpTargetId: zod_1.default.string().optional()
|
|
233
232
|
});
|
|
234
233
|
exports2.runApiRunOptionsSchema = zod_1.default.discriminatedUnion("environment", [
|
|
235
234
|
exports2.runApiStandaloneRunOptionsSchema,
|