@mind-harness/mh-browser 0.1.5 → 0.1.6
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/extension/manifest.json +1 -1
- package/lib/index.js +11 -1
- package/lib/types/service/browser.d.ts +7 -0
- package/package.json +1 -1
package/extension/manifest.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -2952,6 +2952,15 @@ function missingExecutable(error) {
|
|
|
2952
2952
|
return /ENOENT|doesn.t exist|Executable doesn't exist|not found/i.test(message);
|
|
2953
2953
|
}
|
|
2954
2954
|
/**
|
|
2955
|
+
* Playwright appends `--no-sandbox` unless this is true, and branded Chrome
|
|
2956
|
+
* then warns that stability and security will suffer. An installed browser
|
|
2957
|
+
* sandboxes on every platform. Playwright's own Chromium does too, except on
|
|
2958
|
+
* Linux, where that build has no usable sandbox helper and would fail to start.
|
|
2959
|
+
*/
|
|
2960
|
+
function chromiumSandboxEnabled(browser, platform = process.platform) {
|
|
2961
|
+
return platform !== "linux" || browser !== "chromium";
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2955
2964
|
* One persistent context for the whole process. `chromium` omits `channel`
|
|
2956
2965
|
* so Playwright uses its own browser; the others use a local install.
|
|
2957
2966
|
* A missing browser is reported and not downloaded.
|
|
@@ -2962,6 +2971,7 @@ async function launchBrowser(options) {
|
|
|
2962
2971
|
return await chromium.launchPersistentContext(options.profileDir, {
|
|
2963
2972
|
headless: options.headless,
|
|
2964
2973
|
acceptDownloads: true,
|
|
2974
|
+
chromiumSandbox: chromiumSandboxEnabled(options.browser),
|
|
2965
2975
|
...options.headless ? {} : {
|
|
2966
2976
|
ignoreDefaultArgs: ["--disable-extensions"],
|
|
2967
2977
|
args: ["--enable-unsafe-extension-debugging", "--keep-alive-for-test"]
|
|
@@ -6667,7 +6677,7 @@ function browserDownloadTool(ctx) {
|
|
|
6667
6677
|
const HANDOVER = [
|
|
6668
6678
|
"Hand the browser to the person and wait until they hand it back.",
|
|
6669
6679
|
"The person can take over a tab at any time; that stops the action in progress on that tab, and a tab they have touched stays with them until they hand it back. Other tabs keep working.",
|
|
6670
|
-
"Call it instead of filling or submitting a login form, a
|
|
6680
|
+
"Call it instead of filling or submitting a login form, a Mind Harness login or consent form, or any form that issues credentials, and whenever only the person can continue."
|
|
6671
6681
|
].join(" ");
|
|
6672
6682
|
const REASON = "The sentence the person sees on the handover card, unchanged.";
|
|
6673
6683
|
const TAB = "Tab id of the human page to show the person, copied from a page element's tab attribute. Omit it to hand over without naming a tab; that does not pick the latest result. A page with an Agent View has no tab until you open it with snapshot.";
|
|
@@ -7,6 +7,13 @@ export interface LaunchOptions {
|
|
|
7
7
|
/** Test hook: point at a missing executable to exercise the not-found message. */
|
|
8
8
|
executablePath?: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Playwright appends `--no-sandbox` unless this is true, and branded Chrome
|
|
12
|
+
* then warns that stability and security will suffer. An installed browser
|
|
13
|
+
* sandboxes on every platform. Playwright's own Chromium does too, except on
|
|
14
|
+
* Linux, where that build has no usable sandbox helper and would fail to start.
|
|
15
|
+
*/
|
|
16
|
+
export declare function chromiumSandboxEnabled(browser: BrowserName, platform?: NodeJS.Platform): boolean;
|
|
10
17
|
/**
|
|
11
18
|
* One persistent context for the whole process. `chromium` omits `channel`
|
|
12
19
|
* so Playwright uses its own browser; the others use a local install.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mind-harness/mh-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Opens pages in a real browser for the agent, keeps chosen Agent Views in context, and hands the browser to you when a person is needed.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"files": [
|