dsh-browser-plus 0.0.0-stage → 0.5.1
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 +153 -0
- package/LICENSE +22 -0
- package/NOTICE.md +7 -0
- package/README.en.md +119 -0
- package/README.md +118 -2
- package/assets/dsh-browser-plus-256.png +0 -0
- package/assets/dsh-browser-plus-512.png +0 -0
- package/assets/dsh-browser-plus-small.svg +9 -0
- package/assets/dsh-browser-plus.ico +0 -0
- package/assets/dsh-browser-plus.svg +11 -0
- package/assets/readme-workspace.png +0 -0
- package/client/index.js +185 -0
- package/cordis.patch.yml +41 -0
- package/docs/MIGRATION.md +48 -0
- package/docs/README.md +22 -0
- package/docs/SOAK-CHECKLIST.md +98 -0
- package/docs/architecture.md +88 -0
- package/docs/tool-reference.md +126 -0
- package/docs/user-guide.md +137 -0
- package/docs/why-browser.md +45 -0
- package/lib/browser/runtime.d.ts +238 -0
- package/lib/browser/runtime.js +330 -0
- package/lib/browser/types.d.ts +758 -0
- package/lib/browser/types.js +18 -0
- package/lib/browser-electron/auth-cookies.d.ts +54 -0
- package/lib/browser-electron/auth-cookies.js +83 -0
- package/lib/browser-electron/chrome-state.d.ts +211 -0
- package/lib/browser-electron/chrome-state.js +12 -0
- package/lib/browser-electron/entry.d.ts +73 -0
- package/lib/browser-electron/entry.js +65 -0
- package/lib/browser-electron/fingerprint.d.ts +29 -0
- package/lib/browser-electron/fingerprint.js +42 -0
- package/lib/browser-electron/host-main.d.ts +19 -0
- package/lib/browser-electron/host-main.js +2691 -0
- package/lib/browser-electron/icon.d.ts +11 -0
- package/lib/browser-electron/icon.js +23 -0
- package/lib/browser-electron/page-chrome.d.ts +21 -0
- package/lib/browser-electron/page-chrome.js +2269 -0
- package/lib/browser-electron/provider.d.ts +767 -0
- package/lib/browser-electron/provider.js +2825 -0
- package/lib/browser-electron/remote-host.d.ts +145 -0
- package/lib/browser-electron/remote-host.js +993 -0
- package/lib/browser-electron/task-summary.d.ts +2 -0
- package/lib/browser-electron/task-summary.js +12 -0
- package/lib/browser-electron/task-thumbnail.d.ts +11 -0
- package/lib/browser-electron/task-thumbnail.js +9 -0
- package/lib/browser-electron/write-guard.d.ts +41 -0
- package/lib/browser-electron/write-guard.js +123 -0
- package/lib/client.js +185 -0
- package/lib/command-browser/index.d.ts +20 -0
- package/lib/command-browser/index.js +35 -0
- package/lib/http-browser/index.d.ts +28 -0
- package/lib/http-browser/index.js +110 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.js +25 -0
- package/lib/task-todos/index.d.ts +25 -0
- package/lib/task-todos/index.js +100 -0
- package/lib/tool-browser/index.d.ts +31 -0
- package/lib/tool-browser/index.js +2026 -0
- package/package.json +120 -4
- package/screenshots.json +3 -0
- package/scripts/build-client.mjs +20 -0
- package/scripts/build-icons.mjs +80 -0
- package/scripts/capture-window.ps1 +79 -0
- package/scripts/crop-image.ps1 +20 -0
- package/scripts/smoke-browser-tools.mjs +2051 -0
- package/scripts/smoke-chrome-world.mjs +65 -0
- package/scripts/smoke-electron-host.mjs +50 -0
- package/scripts/test-orb-drag.mjs +83 -0
- package/src/browser/runtime.ts +506 -0
- package/src/browser/types.ts +741 -0
- package/src/browser-electron/auth-cookies.ts +125 -0
- package/src/browser-electron/chrome-state.ts +192 -0
- package/src/browser-electron/entry.ts +125 -0
- package/src/browser-electron/fingerprint.ts +45 -0
- package/src/browser-electron/host-main.ts +2526 -0
- package/src/browser-electron/icon.ts +26 -0
- package/src/browser-electron/page-chrome.ts +2281 -0
- package/src/browser-electron/provider.ts +3366 -0
- package/src/browser-electron/remote-host.ts +1051 -0
- package/src/browser-electron/task-summary.ts +10 -0
- package/src/browser-electron/task-thumbnail.ts +17 -0
- package/src/browser-electron/write-guard.ts +134 -0
- package/src/command-browser/index.ts +61 -0
- package/src/http-browser/index.ts +139 -0
- package/src/index.ts +65 -0
- package/src/task-todos/index.ts +114 -0
- package/src/tool-browser/index.ts +2071 -0
- package/src/types/electron-shim.d.ts +143 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform icon resolver for the shared browser host window.
|
|
3
|
+
*
|
|
4
|
+
* Maps the current platform to the matching generated icon derivative and
|
|
5
|
+
* returns its absolute path, or undefined when the asset is missing (so the
|
|
6
|
+
* host can build the window without the icon rather than fail). No files are
|
|
7
|
+
* read at import time; only the resolver itself touches the filesystem.
|
|
8
|
+
* @module dsh-browser-plus/browser-electron/icon
|
|
9
|
+
*/
|
|
10
|
+
/** Absolute path of this platform's BrowserWindow icon, or undefined. */
|
|
11
|
+
export declare function resolveBrowserIconPath(platform?: NodeJS.Platform): string | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform icon resolver for the shared browser host window.
|
|
3
|
+
*
|
|
4
|
+
* Maps the current platform to the matching generated icon derivative and
|
|
5
|
+
* returns its absolute path, or undefined when the asset is missing (so the
|
|
6
|
+
* host can build the window without the icon rather than fail). No files are
|
|
7
|
+
* read at import time; only the resolver itself touches the filesystem.
|
|
8
|
+
* @module dsh-browser-plus/browser-electron/icon
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync } from 'node:fs';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
/** Icon filename for each platform; any unknown platform falls back to linux. */
|
|
13
|
+
const ICON_BY_PLATFORM = {
|
|
14
|
+
win32: 'dsh-browser-plus.ico',
|
|
15
|
+
darwin: 'dsh-browser-plus-512.png',
|
|
16
|
+
linux: 'dsh-browser-plus-256.png',
|
|
17
|
+
};
|
|
18
|
+
/** Absolute path of this platform's BrowserWindow icon, or undefined. */
|
|
19
|
+
export function resolveBrowserIconPath(platform = process.platform) {
|
|
20
|
+
const filename = ICON_BY_PLATFORM[platform] ?? ICON_BY_PLATFORM.linux;
|
|
21
|
+
const path = fileURLToPath(new URL('../../assets/' + filename, import.meta.url));
|
|
22
|
+
return existsSync(path) ? path : undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-facing browser chrome injected into the top-level page document.
|
|
3
|
+
* Keeping this UI in the page renderer avoids a second Electron
|
|
4
|
+
* WebContentsView and leaves the host composition tree stable.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PAGE_CHROME_HOST_ID = "__dsh_browser_chrome_host__";
|
|
7
|
+
export declare const PAGE_CHROME_ATTRIBUTE = "data-dsh-browser-chrome";
|
|
8
|
+
/** Generated once; stable across documents and reused by the provider. */
|
|
9
|
+
export declare const PAGE_CHROME_SCRIPT: string;
|
|
10
|
+
/** Convert human address-bar text into an allowed HTTP(S) navigation target. */
|
|
11
|
+
export declare function normalizeBrowserAddress(raw: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Build a self-contained CDP page-start script.
|
|
14
|
+
*
|
|
15
|
+
* @param bindingToken - per-view secret echoed back on every chrome control
|
|
16
|
+
* message. It is captured in the injected IIFE's closure, so page scripts can
|
|
17
|
+
* call the CDP binding but cannot read the token back out. Omit it for hosts
|
|
18
|
+
* that do not authenticate page-emitted controls (see {@link PAGE_CHROME_SCRIPT}).
|
|
19
|
+
*/
|
|
20
|
+
export type ChromeSurface = 'full' | 'frame' | 'page';
|
|
21
|
+
export declare function buildPageChromeScript(bindingToken?: string, surface?: ChromeSurface): string;
|