@intuned/runtime-dev 1.3.17 → 1.3.18-browser1

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UNRELEASED
2
2
 
3
- -
3
+ - Add `timeout` parameter (in seconds, defaults to 30) to `launchBrowser` and `launchChromium` functions
4
4
 
5
5
  # 1.3.11
6
6
 
@@ -58,9 +58,12 @@ async function getStorageState(context) {
58
58
  result.cookies = storageState.cookies;
59
59
  result.origins = storageState.origins;
60
60
  const sessionDataList = [];
61
- const pages = await context.pages();
61
+ const pages = context.pages();
62
62
  for (const page of pages) {
63
63
  if (page.isClosed()) continue;
64
+ if (page.url() === "about:blank" || page.url() === "chrome://newtab/" || page.url() === "edge://newtab/") {
65
+ continue;
66
+ }
64
67
  try {
65
68
  const sessionData = await page.evaluate(() => {
66
69
  const items = {
@@ -16,10 +16,12 @@ export type LaunchChromiumStandaloneOptions = {
16
16
  cdpPort?: number;
17
17
  appModeInitialUrl?: string;
18
18
  executablePath?: string;
19
+ timeout?: number;
19
20
  };
20
21
  export type LaunchChromiumCdpOptions = {
21
22
  cdpAddress: string;
22
23
  cdpTargetId?: string;
24
+ timeout?: number;
23
25
  };
24
26
  export declare function launchChromium(options: LaunchChromiumStandaloneOptions): Promise<LaunchBrowserResult>;
25
27
  export declare function launchChromium(options: LaunchChromiumCdpOptions): Promise<LaunchBrowserResult>;
@@ -66,6 +66,9 @@ async function launchChromium(options) {
66
66
  }
67
67
  }
68
68
  }
69
+ if (options.timeout !== undefined) {
70
+ context.setDefaultTimeout(options.timeout * 1000);
71
+ }
69
72
  return {
70
73
  page,
71
74
  context
@@ -76,13 +79,18 @@ async function launchChromium(options) {
76
79
  appModeInitialUrl,
77
80
  cdpPort,
78
81
  proxy,
79
- downloadsPath
82
+ downloadsPath,
83
+ timeout
80
84
  } = options;
81
85
  let {
82
86
  executablePath
83
87
  } = options;
84
88
  const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
85
89
  const extraArgs = [];
90
+ const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
91
+ if (stealthConfig.enabled && stealthConfig.type === "intunedBrowser") {
92
+ extraArgs.push("--stealth-mode");
93
+ }
86
94
  const userDataDir = await createUserDirWithPreferences();
87
95
  if ((0, _extensionsHelpers.isIntunedExtensionLoaded)()) {
88
96
  const extensionsList = (0, _extensionsHelpers.buildExtensionsList)();
@@ -127,6 +135,9 @@ async function launchChromium(options) {
127
135
  args: extraArgs,
128
136
  ignoreDefaultArgs: defaultArgsToIgnore
129
137
  });
138
+ if (timeout !== undefined) {
139
+ context.setDefaultTimeout(timeout * 1000);
140
+ }
130
141
  context.once("close", async () => {
131
142
  try {
132
143
  await (0, _fsExtra.rm)(userDataDir, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.17",
3
+ "version": "1.3.18-browser1",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",