@intuned/runtime-dev 1.3.27-dev4 → 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", "--password-store=basic"];
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,9 +26,16 @@ 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 getKeychainBypassArgs() {
29
- const args = ["--password-store=basic"];
30
- if (process.platform === "darwin" && process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS !== "0") {
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");
37
+ }
38
+ if (platform === "darwin" && disableMacKeychainPrompts !== "0") {
31
39
  args.unshift("--use-mock-keychain");
32
40
  }
33
41
  return args;
@@ -150,8 +158,10 @@ async function launchChromium(options) {
150
158
  const ignoreHttpErrors = await getIgnoreHttpErrorsFromConfig(ignoreHttpErrorsParam);
151
159
  const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
152
160
  const extraArgs = ["--disable-notifications"];
153
- const keychainBypassArgs = getKeychainBypassArgs();
154
- extraArgs.push(...keychainBypassArgs);
161
+ const portableProfileArgs = getPortableProfileChromeArgs({
162
+ profileTemplatePath
163
+ });
164
+ extraArgs.push(...portableProfileArgs);
155
165
  const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
156
166
  if (stealthConfig.enabled) {
157
167
  extraArgs.push("--stealth-mode");
@@ -194,7 +204,7 @@ async function launchChromium(options) {
194
204
  const viewport = null;
195
205
  const userAgent = process.env.__PLAYWRIGHT_USER_AGENT_OVERRIDE ?? (await getHeadlessUserAgent({
196
206
  executablePath,
197
- args: keychainBypassArgs
207
+ args: portableProfileArgs
198
208
  }));
199
209
  const context = await playwright.chromium.launchPersistentContext(userDataDir, {
200
210
  userAgent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.27-dev4",
3
+ "version": "1.3.27-dev5",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",
Binary file