@intuned/runtime-dev 1.3.27-dev2 → 1.3.27-dev4

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.
@@ -25,14 +25,12 @@ var _intunedJson = require("./intunedJson");
25
25
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
26
26
  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
27
  const execAsync = (0, _util.promisify)(_child_process.exec);
28
- function getMacKeychainBypassArgs() {
29
- if (process.platform !== "darwin") {
30
- return [];
28
+ function getKeychainBypassArgs() {
29
+ const args = ["--password-store=basic"];
30
+ if (process.platform === "darwin" && process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS !== "0") {
31
+ args.unshift("--use-mock-keychain");
31
32
  }
32
- if (process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS === "0") {
33
- return [];
34
- }
35
- return ["--use-mock-keychain", "--password-store=basic"];
33
+ return args;
36
34
  }
37
35
  const DEFAULT_USER_PREFERENCES = {
38
36
  plugins: {
@@ -49,10 +47,13 @@ async function createUserDirWithPreferences(profileTemplatePath) {
49
47
  const defaultDir = (0, _path.join)(userDir, "Default");
50
48
  const preferencesPath = (0, _path.join)(defaultDir, "Preferences");
51
49
  if (profileTemplatePath && (await fs.pathExists(profileTemplatePath))) {
52
- await fs.copy(profileTemplatePath, defaultDir, {
50
+ await fs.copy(profileTemplatePath, userDir, {
53
51
  overwrite: true,
54
52
  errorOnExist: false
55
53
  });
54
+ await (0, _fsExtra.mkdir)(defaultDir, {
55
+ recursive: true
56
+ });
56
57
  let templatePreferences = {};
57
58
  if (await fs.pathExists(preferencesPath)) {
58
59
  try {
@@ -62,9 +63,6 @@ async function createUserDirWithPreferences(profileTemplatePath) {
62
63
  }
63
64
  }
64
65
  const mergedPreferences = mergePreferences(templatePreferences, DEFAULT_USER_PREFERENCES);
65
- await (0, _fsExtra.mkdir)(defaultDir, {
66
- recursive: true
67
- });
68
66
  await (0, _fsExtra.writeFile)(preferencesPath, JSON.stringify(mergedPreferences));
69
67
  return userDir;
70
68
  }
@@ -152,8 +150,8 @@ async function launchChromium(options) {
152
150
  const ignoreHttpErrors = await getIgnoreHttpErrorsFromConfig(ignoreHttpErrorsParam);
153
151
  const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
154
152
  const extraArgs = ["--disable-notifications"];
155
- const macKeychainBypassArgs = getMacKeychainBypassArgs();
156
- extraArgs.push(...macKeychainBypassArgs);
153
+ const keychainBypassArgs = getKeychainBypassArgs();
154
+ extraArgs.push(...keychainBypassArgs);
157
155
  const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
158
156
  if (stealthConfig.enabled) {
159
157
  extraArgs.push("--stealth-mode");
@@ -196,7 +194,7 @@ async function launchChromium(options) {
196
194
  const viewport = null;
197
195
  const userAgent = process.env.__PLAYWRIGHT_USER_AGENT_OVERRIDE ?? (await getHeadlessUserAgent({
198
196
  executablePath,
199
- args: macKeychainBypassArgs
197
+ args: keychainBypassArgs
200
198
  }));
201
199
  const context = await playwright.chromium.launchPersistentContext(userDataDir, {
202
200
  userAgent,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.27-dev2",
3
+ "version": "1.3.27-dev4",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",