@intuned/runtime-dev 1.3.27-dev3 → 1.3.27-dev5
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.
|
@@ -22,7 +22,7 @@ function getMacKeychainBypassArgs() {
|
|
|
22
22
|
if (process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS === "0") {
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
25
|
-
return ["--use-mock-keychain"
|
|
25
|
+
return ["--use-mock-keychain"];
|
|
26
26
|
}
|
|
27
27
|
const getChromiumLaunchArgs = () => ["--no-sandbox", `--remote-debugging-port=${REMOTE_DEBUGGING_PORT}`, `--user-data-dir=/tmp/${Date.now()}`, "--new-window", "--start-maximized", "--disable-popup-blocking", ...getMacKeychainBypassArgs()];
|
|
28
28
|
exports.getChromiumLaunchArgs = getChromiumLaunchArgs;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import * as playwright from "playwright";
|
|
2
3
|
import { Result } from "neverthrow";
|
|
4
|
+
export declare function getPortableProfileChromeArgs({ profileTemplatePath, platform, disableMacKeychainPrompts, }: {
|
|
5
|
+
profileTemplatePath?: string;
|
|
6
|
+
platform?: NodeJS.Platform;
|
|
7
|
+
disableMacKeychainPrompts?: string;
|
|
8
|
+
}): string[];
|
|
3
9
|
export interface Proxy {
|
|
4
10
|
server: string;
|
|
5
11
|
username: string;
|
|
@@ -8,6 +8,7 @@ exports.getCdpWebSocketUrl = getCdpWebSocketUrl;
|
|
|
8
8
|
exports.getHeadlessUserAgent = getHeadlessUserAgent;
|
|
9
9
|
exports.getIgnoreHttpErrorsFromConfig = getIgnoreHttpErrorsFromConfig;
|
|
10
10
|
exports.getLocalCdpAddress = getLocalCdpAddress;
|
|
11
|
+
exports.getPortableProfileChromeArgs = getPortableProfileChromeArgs;
|
|
11
12
|
exports.launchBrowser = launchBrowser;
|
|
12
13
|
exports.launchChromium = launchChromium;
|
|
13
14
|
var playwright = _interopRequireWildcard(require("playwright"));
|
|
@@ -25,14 +26,19 @@ var _intunedJson = require("./intunedJson");
|
|
|
25
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
27
28
|
const execAsync = (0, _util.promisify)(_child_process.exec);
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
function getPortableProfileChromeArgs({
|
|
30
|
+
profileTemplatePath,
|
|
31
|
+
platform = process.platform,
|
|
32
|
+
disableMacKeychainPrompts = process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS
|
|
33
|
+
}) {
|
|
34
|
+
const args = [];
|
|
35
|
+
if (profileTemplatePath) {
|
|
36
|
+
args.unshift("--password-store=basic");
|
|
31
37
|
}
|
|
32
|
-
if (
|
|
33
|
-
|
|
38
|
+
if (platform === "darwin" && disableMacKeychainPrompts !== "0") {
|
|
39
|
+
args.unshift("--use-mock-keychain");
|
|
34
40
|
}
|
|
35
|
-
return
|
|
41
|
+
return args;
|
|
36
42
|
}
|
|
37
43
|
const DEFAULT_USER_PREFERENCES = {
|
|
38
44
|
plugins: {
|
|
@@ -152,8 +158,10 @@ async function launchChromium(options) {
|
|
|
152
158
|
const ignoreHttpErrors = await getIgnoreHttpErrorsFromConfig(ignoreHttpErrorsParam);
|
|
153
159
|
const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
|
|
154
160
|
const extraArgs = ["--disable-notifications"];
|
|
155
|
-
const
|
|
156
|
-
|
|
161
|
+
const portableProfileArgs = getPortableProfileChromeArgs({
|
|
162
|
+
profileTemplatePath
|
|
163
|
+
});
|
|
164
|
+
extraArgs.push(...portableProfileArgs);
|
|
157
165
|
const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
|
|
158
166
|
if (stealthConfig.enabled) {
|
|
159
167
|
extraArgs.push("--stealth-mode");
|
|
@@ -196,7 +204,7 @@ async function launchChromium(options) {
|
|
|
196
204
|
const viewport = null;
|
|
197
205
|
const userAgent = process.env.__PLAYWRIGHT_USER_AGENT_OVERRIDE ?? (await getHeadlessUserAgent({
|
|
198
206
|
executablePath,
|
|
199
|
-
args:
|
|
207
|
+
args: portableProfileArgs
|
|
200
208
|
}));
|
|
201
209
|
const context = await playwright.chromium.launchPersistentContext(userDataDir, {
|
|
202
210
|
userAgent,
|
package/package.json
CHANGED
|
Binary file
|