dsh-builtin-browser 1.0.1 → 1.0.3
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 +55 -0
- package/README.md +1 -1
- package/assets/browser-panel-locales.mjs +37 -5
- package/assets/browser-policy.d.mts +29 -0
- package/assets/browser-policy.mjs +40 -0
- package/desktop-bridge/desktop-discovery.d.mts +1 -1
- package/desktop-bridge/desktop-discovery.mjs +59 -9
- package/desktop-bridge/desktop-identity.json +12 -0
- package/desktop-bridge/install.mjs +14 -7
- package/desktop-bridge/plugin-browser-bridge.js +19 -7
- package/docs/acceptance-2026-11-27.md +67 -0
- package/docs/architecture.md +1 -1
- package/docs/development.md +33 -4
- package/docs/dsh-0.2.3-host-patch-task.md +34 -0
- package/docs/hardcoding-audit.md +28 -8
- package/docs/known-issues.md +26 -0
- package/docs/limitations.md +6 -2
- package/docs/tool-reference.md +1 -1
- package/docs/v1.1.0-bu-data-batching-task.md +66 -0
- package/docs/v1.1.0-compat-hardcoding-task.md +85 -0
- package/dsh-builtin-browser-1.0.3-publish.tgz +0 -0
- package/dsh-builtin-browser-1.0.3.tgz +0 -0
- package/dsh-host-patch/README.md +4 -0
- package/dsh-host-patch/apply.mjs +61 -13
- package/dsh-host-patch/rc3-revision9.json.gz +0 -0
- package/dsh-host-patch/rc5-revision9.json.gz +0 -0
- package/dsh-host-patch/sources/main/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
- package/dsh-host-patch/sources/main/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
- package/dsh-host-patch/sources/manifest.json +218 -0
- package/dsh-host-patch/sources/rc3/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
- package/dsh-host-patch/sources/rc3/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
- package/dsh-host-patch/sources/rc5/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
- package/dsh-host-patch/sources/series.json +260 -0
- package/dsh-host-patch/tauri/desktop-main.cjs +62 -0
- package/dsh-host-patch/tauri/sidebar-session.cjs +104 -0
- package/dsh-host-patch/tauri-revision1.json +39 -0
- package/dsh-host-patch/tauri.json +43 -0
- package/dsh-host-patch/v023-alpha2.json +153 -0
- package/lib/browser/anti-bot.js +215 -0
- package/lib/browser/deep-dom.js +39 -0
- package/lib/browser/runtime.js +15 -0
- package/lib/browser/takeover-target.js +13 -6
- package/lib/browser/types.js +30 -1
- package/lib/browser-electron/authenticated-route.js +16 -2
- package/lib/browser-electron/automatic-maintenance.js +16 -10
- package/lib/browser-electron/bridge-connection.js +3 -8
- package/lib/browser-electron/bridge-install.js +2 -1
- package/lib/browser-electron/bridge-status.js +55 -26
- package/lib/browser-electron/desktop-bridge-host.js +7 -6
- package/lib/browser-electron/desktop-identity.js +28 -5
- package/lib/browser-electron/desktop-shell.js +64 -0
- package/lib/browser-electron/electron-provision.js +105 -18
- package/lib/browser-electron/entry.js +129 -44
- package/lib/browser-electron/extension-browser.js +4 -4
- package/lib/browser-electron/foreground-watch.js +134 -0
- package/lib/browser-electron/guest-cookie-jar.js +13 -13
- package/lib/browser-electron/guest-route.js +181 -32
- package/lib/browser-electron/guest-runtime.js +61 -10
- package/lib/browser-electron/guest-storage.js +2 -2
- package/lib/browser-electron/history-store.js +1 -5
- package/lib/browser-electron/host-main.js +8 -4
- package/lib/browser-electron/host-patch-maintenance.js +14 -8
- package/lib/browser-electron/maintenance-route.js +2 -1
- package/lib/browser-electron/missing-system-browser.js +5 -9
- package/lib/browser-electron/preferred-browser.js +7 -3
- package/lib/browser-electron/preview-route.js +9 -13
- package/lib/browser-electron/process-ownership.js +1 -1
- package/lib/browser-electron/profile-command.js +2 -1
- package/lib/browser-electron/profile-extension.js +5 -0
- package/lib/browser-electron/profile-lease.js +152 -47
- package/lib/browser-electron/provider-core.js +527 -0
- package/lib/browser-electron/provider-interaction.js +963 -0
- package/lib/browser-electron/provider-media.js +518 -0
- package/lib/browser-electron/provider-navigation.js +301 -0
- package/lib/browser-electron/provider-observation.js +623 -0
- package/lib/browser-electron/provider-tabs.js +372 -0
- package/lib/browser-electron/provider.js +150 -3301
- package/lib/browser-electron/reference-route.js +9 -18
- package/lib/browser-electron/remote-host.js +79 -34
- package/lib/browser-electron/runtime-status.js +56 -6
- package/lib/browser-electron/settings-store.js +3 -6
- package/lib/browser-electron/sidebar-only-host.js +1 -1
- package/lib/browser-electron/system-browser.js +539 -172
- package/lib/browser-electron/tauri-host.js +208 -0
- package/lib/browser-electron/virtual-cursor.js +23 -13
- package/lib/browser-reference/service.js +22 -4
- package/lib/browser-reference/web-sources.js +1 -1
- package/lib/client.js +43409 -0
- package/lib/compat/host-features.js +75 -0
- package/lib/reference-source.js +1 -1
- package/lib/reference-text.js +23 -1
- package/lib/takeover-protocol.js +1 -1
- package/lib/tool-browser/block-recovery.js +69 -0
- package/lib/tool-browser/code-tool.js +170 -19
- package/lib/tool-browser/code-worker.js +115 -20
- package/lib/tool-browser/errors.js +34 -0
- package/lib/tool-browser/index.js +66 -3593
- package/lib/tool-browser/page-probe.js +227 -28
- package/lib/tool-browser/panel-page.js +2 -1
- package/lib/tool-browser/probe-client.js +157 -0
- package/lib/tool-browser/screenshot-annotations.js +108 -0
- package/lib/tool-browser/state.js +337 -0
- package/lib/tool-browser/takeover.js +1 -1
- package/lib/tool-browser/tools-debug.js +862 -0
- package/lib/tool-browser/tools-interaction.js +993 -0
- package/lib/tool-browser/tools-navigation.js +807 -0
- package/lib/tool-browser/tools-observation.js +461 -0
- package/lib/tool-browser/tools-reference.js +293 -0
- package/lib/web-guest.js +1 -0
- package/package.json +15 -53
- package/README.en.md +0 -89
- package/browser-extension/constants.mjs +0 -20
- package/browser-extension/controller.mjs +0 -293
- package/browser-extension/locales.mjs +0 -15
- package/browser-extension/manifest.json +0 -12
- package/browser-extension/options.html +0 -14
- package/browser-extension/options.mjs +0 -9
- package/browser-extension/permission-guard.mjs +0 -13
- package/browser-extension/worker.mjs +0 -74
- package/dist/client.cjs +0 -43167
- package/lib/browser-reference/submission-receipts.js +0 -139
- package/scripts/build.mjs +0 -66
- package/scripts/bundle-host.mjs +0 -28
- package/scripts/fix-exports.mjs +0 -50
- package/scripts/install-electron.mjs +0 -51
- package/scripts/verify-exports.mjs +0 -47
- package/scripts/verify-preview-sdk.mjs +0 -93
- package/skills/dsh-builtin-browser/SKILL.md +0 -73
- package/skills/dsh-builtin-browser/references/batch.md +0 -53
- package/skills/dsh-builtin-browser/references/deliver.md +0 -31
- package/skills/dsh-builtin-browser/references/locate.md +0 -11
- package/skills/dsh-builtin-browser/references/recover.md +0 -11
- package/skills/dsh-builtin-browser/references/verify.md +0 -13
- package/skills/dsh-debug-host/SKILL.md +0 -56
- package/skills/dsh-debug-self/SKILL.md +0 -50
- package/src/bridge-compatibility.ts +0 -39
- package/src/browser/handles.ts +0 -89
- package/src/browser/runtime.ts +0 -560
- package/src/browser/takeover-target.ts +0 -36
- package/src/browser/types.ts +0 -817
- package/src/browser-electron/authenticated-route.ts +0 -84
- package/src/browser-electron/automatic-maintenance.ts +0 -726
- package/src/browser-electron/bridge-auto.ts +0 -159
- package/src/browser-electron/bridge-connection.ts +0 -385
- package/src/browser-electron/bridge-endpoint.ts +0 -129
- package/src/browser-electron/bridge-install.ts +0 -289
- package/src/browser-electron/bridge-maintenance.ts +0 -189
- package/src/browser-electron/bridge-status.ts +0 -347
- package/src/browser-electron/desktop-bridge-host.ts +0 -251
- package/src/browser-electron/desktop-identity.ts +0 -320
- package/src/browser-electron/document-readiness.ts +0 -45
- package/src/browser-electron/electron-provision.ts +0 -261
- package/src/browser-electron/entry.ts +0 -1299
- package/src/browser-electron/ephemeral-profile.ts +0 -189
- package/src/browser-electron/extension-browser.ts +0 -223
- package/src/browser-electron/extension-setup.ts +0 -67
- package/src/browser-electron/file-write.ts +0 -31
- package/src/browser-electron/guest-cookie-jar.ts +0 -176
- package/src/browser-electron/guest-cookie-store.ts +0 -59
- package/src/browser-electron/guest-css-runtime.ts +0 -76
- package/src/browser-electron/guest-css.ts +0 -68
- package/src/browser-electron/guest-route.ts +0 -568
- package/src/browser-electron/guest-runtime.ts +0 -357
- package/src/browser-electron/guest-storage-runtime.ts +0 -54
- package/src/browser-electron/guest-storage.ts +0 -117
- package/src/browser-electron/history-store.ts +0 -227
- package/src/browser-electron/host-main.ts +0 -1381
- package/src/browser-electron/host-patch-maintenance.ts +0 -112
- package/src/browser-electron/http-body.ts +0 -65
- package/src/browser-electron/json-reply.ts +0 -47
- package/src/browser-electron/maintenance-broker.ts +0 -166
- package/src/browser-electron/maintenance-lifecycle.ts +0 -91
- package/src/browser-electron/maintenance-route.ts +0 -67
- package/src/browser-electron/missing-system-browser.ts +0 -113
- package/src/browser-electron/open-slot.ts +0 -49
- package/src/browser-electron/paths.ts +0 -25
- package/src/browser-electron/preferred-browser.ts +0 -120
- package/src/browser-electron/preview-route.ts +0 -218
- package/src/browser-electron/process-ownership.ts +0 -168
- package/src/browser-electron/process.ts +0 -23
- package/src/browser-electron/profile-checkpoint.ts +0 -187
- package/src/browser-electron/profile-command.ts +0 -46
- package/src/browser-electron/profile-extension.ts +0 -124
- package/src/browser-electron/profile-lease.ts +0 -115
- package/src/browser-electron/profile-residue.ts +0 -49
- package/src/browser-electron/provider.ts +0 -4571
- package/src/browser-electron/reference-route.ts +0 -608
- package/src/browser-electron/remote-host.ts +0 -1462
- package/src/browser-electron/rpc-input.ts +0 -13
- package/src/browser-electron/rpc-ops.ts +0 -41
- package/src/browser-electron/runtime-diagnostics.ts +0 -38
- package/src/browser-electron/runtime-route.ts +0 -105
- package/src/browser-electron/runtime-status.ts +0 -242
- package/src/browser-electron/settings-route.ts +0 -64
- package/src/browser-electron/settings-store.ts +0 -589
- package/src/browser-electron/shortcuts-route.ts +0 -112
- package/src/browser-electron/sidebar-only-host.ts +0 -298
- package/src/browser-electron/startpage-shortcuts.ts +0 -213
- package/src/browser-electron/system-browser.ts +0 -1497
- package/src/browser-electron/timing.ts +0 -16
- package/src/browser-electron/virtual-cursor.ts +0 -152
- package/src/browser-electron/windows-system.ts +0 -24
- package/src/browser-reference/delivery.ts +0 -384
- package/src/browser-reference/entry.ts +0 -631
- package/src/browser-reference/export.ts +0 -339
- package/src/browser-reference/import.ts +0 -303
- package/src/browser-reference/page-script.ts +0 -1537
- package/src/browser-reference/service.ts +0 -1315
- package/src/browser-reference/store.ts +0 -172
- package/src/browser-reference/submission-receipts.ts +0 -122
- package/src/browser-reference/text-quote.ts +0 -219
- package/src/browser-reference/types.ts +0 -195
- package/src/browser-reference/visible.ts +0 -367
- package/src/browser-reference/web-sources.ts +0 -103
- package/src/client/browser/BrowserController.ts +0 -693
- package/src/client/browser/BrowserFrame.ts +0 -78
- package/src/client/browser/BrowserNavigation.ts +0 -169
- package/src/client/browser/BrowserPage.ts +0 -23
- package/src/client/browser/BrowserPersistence.ts +0 -44
- package/src/client/browser/IframeImpl.ts +0 -176
- package/src/client/browser/child-tabs.ts +0 -14
- package/src/client/browser/iframe-reference.ts +0 -67
- package/src/client/browser/initialization.ts +0 -262
- package/src/client/browser/omnibox.ts +0 -243
- package/src/client/browser/store.ts +0 -38
- package/src/client/browser/takeover-channel.ts +0 -72
- package/src/client/browser/url.ts +0 -46
- package/src/client/browser/web-reference-source.ts +0 -52
- package/src/client/css-modules.d.ts +0 -4
- package/src/client/definition.tsx +0 -30
- package/src/client/electron/ElectronWebViewImpl.ts +0 -364
- package/src/client/electron/ElectronWebviewPresentation.ts +0 -138
- package/src/client/electron/NativeChildPresentation.ts +0 -45
- package/src/client/electron/NativeViewPage.ts +0 -251
- package/src/client/electron/pages.ts +0 -23
- package/src/client/electron/reference-overlay.ts +0 -53
- package/src/client/electron/workspace.ts +0 -33
- package/src/client/index.ts +0 -293
- package/src/client/locales.ts +0 -857
- package/src/client/pages.ts +0 -28
- package/src/client/reference/client/BrowserRefLink.tsx +0 -142
- package/src/client/reference/client/draft-reference.ts +0 -167
- package/src/client/reference/client/index.ts +0 -7
- package/src/client/reference/client/ordered-submission.ts +0 -108
- package/src/client/reference/client/pending-delivery.ts +0 -216
- package/src/client/reference/client/plugin.ts +0 -189
- package/src/client/reference/client/production/ReferenceCapsules.tsx +0 -345
- package/src/client/reference/client/production/ReferenceDock.module.css +0 -193
- package/src/client/reference/client/production/ReferenceDock.tsx +0 -6
- package/src/client/reference/client/production/ReferenceFeedback.tsx +0 -15
- package/src/client/reference/client/production/ReferenceMath.tsx +0 -44
- package/src/client/reference/client/production/ReferenceText.tsx +0 -36
- package/src/client/reference/client/production/assembly.ts +0 -471
- package/src/client/reference/client/production/asset-store.ts +0 -144
- package/src/client/reference/client/production/availability.ts +0 -74
- package/src/client/reference/client/production/bytes.ts +0 -36
- package/src/client/reference/client/production/delivery-client.ts +0 -211
- package/src/client/reference/client/production/draft-adapter.ts +0 -508
- package/src/client/reference/client/production/http-transport.ts +0 -217
- package/src/client/reference/client/production/production-submission.ts +0 -310
- package/src/client/reference/client/production/protocol.ts +0 -231
- package/src/client/reference/client/production/reference-card.ts +0 -240
- package/src/client/reference/client/production/reference-labels.ts +0 -29
- package/src/client/reference/client/production/reply-link-bridge.ts +0 -222
- package/src/client/reference/client/production/reveal.ts +0 -215
- package/src/client/reference/client/production/runtime.ts +0 -1101
- package/src/client/reference/client/production/snapshot-adapter.ts +0 -154
- package/src/client/reference/client/production/source-marker.ts +0 -63
- package/src/client/reference/client/production/source-opener.ts +0 -55
- package/src/client/reference/client/production/styles.ts +0 -104
- package/src/client/reference/client/production/user-text-rule.ts +0 -58
- package/src/client/reference/client/reveal.ts +0 -107
- package/src/client/reference/client/scheme.ts +0 -114
- package/src/client/reference/client/types.ts +0 -168
- package/src/client/reference/css-modules.d.ts +0 -4
- package/src/client/reference/index.ts +0 -11
- package/src/client/reference-capture-owner.ts +0 -162
- package/src/client/reference-intents.ts +0 -36
- package/src/client/settings/index.ts +0 -34
- package/src/client/settings/panel.ts +0 -2657
- package/src/client/shortcut-open.ts +0 -30
- package/src/client/startpage/binding.ts +0 -99
- package/src/client/startpage/controller.ts +0 -303
- package/src/client/startpage/model.ts +0 -279
- package/src/client/view/Browser.module.css +0 -751
- package/src/client/view/BrowserBody.tsx +0 -314
- package/src/client/view/BrowserPresentation.ts +0 -9
- package/src/client/view/BrowserTitle.tsx +0 -17
- package/src/client/view/IframePresentation.ts +0 -344
- package/src/client/view/StartPage.tsx +0 -597
- package/src/client/view/TakeoverBanner.tsx +0 -21
- package/src/index.ts +0 -110
- package/src/reference-owner.ts +0 -5
- package/src/reference-page.ts +0 -9
- package/src/reference-source.ts +0 -3
- package/src/reference-text.ts +0 -197
- package/src/startpage-settings.ts +0 -103
- package/src/startpage.ts +0 -71
- package/src/takeover-protocol.ts +0 -19
- package/src/tool-browser/code-tool.ts +0 -401
- package/src/tool-browser/code-worker.ts +0 -639
- package/src/tool-browser/element-fields.ts +0 -167
- package/src/tool-browser/index.ts +0 -3733
- package/src/tool-browser/page-probe.ts +0 -474
- package/src/tool-browser/panel-page.ts +0 -124
- package/src/tool-browser/screenshot-image.ts +0 -49
- package/src/tool-browser/takeover.ts +0 -198
- package/src/types/electron-shim.d.ts +0 -144
- package/src/types.ts +0 -85
- package/src/web-guest.ts +0 -34
- package/tools/accept-desktop.mjs +0 -148
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
/** Common browser chrome; a presentation adapter attaches the page inside its content container. */
|
|
2
|
-
import { useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react'
|
|
3
|
-
import type { FormEvent, ReactNode } from 'react'
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
IconChevronLeftOutlineRegular,
|
|
7
|
-
IconChevronRightOutlineRegular,
|
|
8
|
-
IconLinkOutlineRegular,
|
|
9
|
-
IconRefreshOutlineRegular, Tooltip,
|
|
10
|
-
IconRightUpOutlineRegular,
|
|
11
|
-
SHIELD_OUTLINE_PATH,
|
|
12
|
-
ICON_REGULAR_STROKE,
|
|
13
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
14
|
-
import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots'
|
|
15
|
-
import type { BrowserInjected } from '../browser/BrowserController.ts'
|
|
16
|
-
import type { BrowserInitFailure } from '../browser/initialization.ts'
|
|
17
|
-
import { emptyBrowserFrame } from '../browser/BrowserFrame.ts'
|
|
18
|
-
import { currentBrowserTarget } from '../browser/BrowserPersistence.ts'
|
|
19
|
-
import { resolveOmniboxInput } from '../browser/omnibox.ts'
|
|
20
|
-
import { searchEnginePreferences } from '../startpage/model.ts'
|
|
21
|
-
import type { StartPageFailure } from '../startpage/model.ts'
|
|
22
|
-
import type { BrowserStore } from '../browser/store.ts'
|
|
23
|
-
import { EngineSettingsDialog, SearchEngineMenu, ShortcutDialog, StartPage } from './StartPage.tsx'
|
|
24
|
-
import { TakeoverBanner } from './TakeoverBanner.tsx'
|
|
25
|
-
import { connectBrowserTakeover } from '../browser/takeover-channel.ts'
|
|
26
|
-
import { iframePage, subscribeIframePages } from '../browser/iframe-reference.ts'
|
|
27
|
-
import type { TakeoverNotice } from '../../takeover-protocol.ts'
|
|
28
|
-
import css from './Browser.module.css'
|
|
29
|
-
|
|
30
|
-
const EMPTY_FRAME = emptyBrowserFrame()
|
|
31
|
-
|
|
32
|
-
function SandboxPolicyIcon({ sandboxed }: { readonly sandboxed: boolean }): ReactNode {
|
|
33
|
-
return (
|
|
34
|
-
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" aria-hidden>
|
|
35
|
-
<path d={SHIELD_OUTLINE_PATH} stroke="currentColor" strokeWidth={ICON_REGULAR_STROKE} strokeLinejoin="round" />
|
|
36
|
-
{sandboxed
|
|
37
|
-
? <path d="M12.1654 5.7552L8.9447 9.41475C8.73044 9.65816 8.53628 9.8804 8.35774 10.0423C8.1713 10.2114 7.94235 10.3717 7.64016 10.4254C7.48207 10.4535 7.32 10.4552 7.16151 10.4294C6.85843 10.3801 6.62728 10.2223 6.43836 10.0559C6.25752 9.89653 6.06037 9.67732 5.84264 9.43705L4.72925 8.20897L5.63557 7.38707L6.74897 8.61594C6.98603 8.87755 7.12974 9.03533 7.24673 9.13839C7.31033 9.19443 7.34485 9.21476 7.35823 9.22122C7.38068 9.22484 7.40352 9.22515 7.42593 9.22122C7.40522 9.22502 7.42893 9.23294 7.53583 9.136C7.65132 9.03126 7.79316 8.87139 8.02643 8.60638L11.2479 4.94763L12.1654 5.7552Z" fill="currentColor" />
|
|
38
|
-
: <path d="M10.6074 4.40278L8.00975 6.99973L10.6074 9.59739L9.59736 10.6074L6.9997 8.00978L4.40274 10.6074L3.3927 9.59739L5.98966 6.99973L3.3927 4.40278L4.40274 3.39273L6.9997 5.98969L9.59736 3.39273L10.6074 4.40278Z" fill="currentColor" transform="translate(1.2 0.8)" />}
|
|
39
|
-
</svg>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Browser body props assembled by the tab seat. */
|
|
44
|
-
export type BrowserBodyProps = PropsRuntime<'sidebar.right.pane.tab'>
|
|
45
|
-
& PropsStore<BrowserStore>
|
|
46
|
-
& PropsLocale<'sidebarBrowser'>
|
|
47
|
-
& InjectFace<BrowserInjected>
|
|
48
|
-
|
|
49
|
-
function useBrowserDraft(url: string | undefined, revision: number): readonly [string, (value: string) => void, () => void] {
|
|
50
|
-
const [edit, setEdit] = useState<{ readonly revision: number; readonly value: string }>()
|
|
51
|
-
return [edit?.revision === revision ? edit.value : url ?? '',
|
|
52
|
-
(value) => { setEdit({ revision, value }) },
|
|
53
|
-
() => { setEdit(undefined) }]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** Render provider-neutral navigation state and optional controls. */
|
|
57
|
-
export function BrowserBody(props: BrowserBodyProps): ReactNode {
|
|
58
|
-
const {
|
|
59
|
-
mount, loadUrl, submitInput, restore, goBack, goForward, reload, setSandbox, shortcuts, engines,
|
|
60
|
-
bindAddressFocus, dismissShortcut, useBrowserState, useStartPage, useStore, useTabInfo, useContextMenu, t, sessionId,
|
|
61
|
-
} = props
|
|
62
|
-
const { tab } = useTabInfo()
|
|
63
|
-
const { getTriggerProps } = useContextMenu()
|
|
64
|
-
useEffect(() => tab.actions.bindCommands({ refresh: () => { reload(tab.id) } }), [tab.actions, tab.id, reload])
|
|
65
|
-
const addressRef = useRef<HTMLInputElement>(null)
|
|
66
|
-
useEffect(() => bindAddressFocus(tab.id, () => {
|
|
67
|
-
const input = addressRef.current
|
|
68
|
-
if (input === null) return
|
|
69
|
-
input.focus()
|
|
70
|
-
input.select()
|
|
71
|
-
}), [bindAddressFocus, tab.id])
|
|
72
|
-
const saved = useStore(state => state.byTab[tab.id])
|
|
73
|
-
const initial = useRef(saved)
|
|
74
|
-
const initialUrl = useRef(tab.navigation.params?.url)
|
|
75
|
-
const initialNavigationRevision = useRef(tab.navigation.revision)
|
|
76
|
-
const lastNavigationRevision = useRef(tab.navigation.revision)
|
|
77
|
-
const [initFailure, setInitFailure] = useState<BrowserInitFailure>()
|
|
78
|
-
// Capability fallback: a caller without the receipt API still gets the old
|
|
79
|
-
// initial-URL path, but never a crash when it returns nothing.
|
|
80
|
-
const runNavigate = (tabId: typeof tab.id, request: { url: string; navigationRevision: number }) => {
|
|
81
|
-
const runner = (props as { navigate?: typeof props.navigate }).navigate
|
|
82
|
-
if (runner !== undefined) return runner(tabId, request)
|
|
83
|
-
const outcome = loadUrl(tabId, request.url)
|
|
84
|
-
return outcome ?? { ok: true as const, requestId: '' }
|
|
85
|
-
}
|
|
86
|
-
const viewportId = useId()
|
|
87
|
-
const [mountEpoch, setMountEpoch] = useState(0)
|
|
88
|
-
const [focused, setFocused] = useState(false)
|
|
89
|
-
const [enginesOpen, setEnginesOpen] = useState(false)
|
|
90
|
-
const [engineFailure, setEngineFailure] = useState<StartPageFailure>()
|
|
91
|
-
const state = useBrowserState(tab.id)
|
|
92
|
-
const takeoverCurrent = useRef<{ url: string; active: boolean; navigationUrl?: string }>({ url: '', active: false })
|
|
93
|
-
const [takeover, setTakeover] = useState<{ notice?: TakeoverNotice; error?: boolean }>({})
|
|
94
|
-
const takeoverChannel = useRef<ReturnType<typeof connectBrowserTakeover>>()
|
|
95
|
-
const webPage = useSyncExternalStore(subscribeIframePages, () => iframePage(sessionId, viewportId))
|
|
96
|
-
const lastVerifiedWebPage = useRef<{ sessionId: string; epoch: number; page: NonNullable<typeof webPage> }>()
|
|
97
|
-
if (webPage) lastVerifiedWebPage.current = { sessionId, epoch: mountEpoch, page: webPage }
|
|
98
|
-
const takeoverWebPage = webPage ?? (lastVerifiedWebPage.current?.sessionId === sessionId
|
|
99
|
-
&& lastVerifiedWebPage.current.epoch === mountEpoch && state?.initialization?.stage !== 'failed' ? lastVerifiedWebPage.current.page : undefined)
|
|
100
|
-
const observedPage = props.currentPage?.(tab.id)
|
|
101
|
-
const carrierPageId = observedPage?.guestId ?? state?.initialization?.guestId
|
|
102
|
-
const pageId = takeoverWebPage?.pageId ?? (carrierPageId?.startsWith('iframe:') ? undefined : carrierPageId)
|
|
103
|
-
takeoverCurrent.current = { url: takeoverWebPage?.url ?? observedPage?.url ?? state?.frame.target?.url ?? '',
|
|
104
|
-
active: tab.visible === true && (takeoverWebPage === undefined || webPage !== undefined),
|
|
105
|
-
...takeoverWebPage?.navigationUrl === undefined ? {} : { navigationUrl: takeoverWebPage.navigationUrl } }
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
if (!pageId) return
|
|
108
|
-
const lifetime = new AbortController()
|
|
109
|
-
takeoverChannel.current = connectBrowserTakeover({ owner: sessionId, tabId: tab.id, pageId,
|
|
110
|
-
current: () => takeoverCurrent.current,
|
|
111
|
-
changed: (notice, error) => { setTakeover({ notice, error }) },
|
|
112
|
-
}, lifetime.signal)
|
|
113
|
-
return () => { lifetime.abort(); takeoverChannel.current = undefined }
|
|
114
|
-
}, [sessionId, tab.id, pageId])
|
|
115
|
-
const startPage = useStartPage(value => value)
|
|
116
|
-
const frame = state?.frame ?? EMPTY_FRAME
|
|
117
|
-
const restoreTarget = state === undefined ? currentBrowserTarget(initial.current) : state.restoreTarget
|
|
118
|
-
const target = frame.target ?? restoreTarget
|
|
119
|
-
const [draft, setDraft, resetDraft] = useBrowserDraft(target?.url ?? initialUrl.current, state?.commandRevision ?? 0)
|
|
120
|
-
|
|
121
|
-
// A trusted navigation aimed at this tab (from the plugin bridge or another
|
|
122
|
-
// sidebar action) changes the revision without remounting the body. Hand the
|
|
123
|
-
// exact (tab, revision) to the controller; a missing controller is rebuilt
|
|
124
|
-
// from the last committed mount instead of being silently ignored.
|
|
125
|
-
useEffect(() => {
|
|
126
|
-
if (tab.navigation.revision === lastNavigationRevision.current) return
|
|
127
|
-
lastNavigationRevision.current = tab.navigation.revision
|
|
128
|
-
const url = tab.navigation.params?.url
|
|
129
|
-
if (url === undefined || url === '') return
|
|
130
|
-
const outcome = runNavigate(tab.id, { url, navigationRevision: tab.navigation.revision })
|
|
131
|
-
setInitFailure(outcome.ok ? undefined : outcome.reason)
|
|
132
|
-
}, [tab.navigation.revision, tab.navigation.params, tab.id, runNavigate])
|
|
133
|
-
|
|
134
|
-
useLayoutEffect(() => {
|
|
135
|
-
const hide = mount({
|
|
136
|
-
tabId: tab.id, sessionId, navigationRevision: initialNavigationRevision.current,
|
|
137
|
-
signal: tab.signal, viewportId, applicationOrigin: window.location.origin,
|
|
138
|
-
initial: initial.current, initialUrl: initialUrl.current,
|
|
139
|
-
openTab: (url) => { tab.actions.openTab('browser', { params: { url }, revealIfOpened: false }) },
|
|
140
|
-
})
|
|
141
|
-
setMountEpoch(value => value + 1)
|
|
142
|
-
return hide
|
|
143
|
-
}, [mount, tab.id, tab.signal, tab.actions, viewportId, props.actions, sessionId])
|
|
144
|
-
|
|
145
|
-
const unknown = frame.address === 'unknown'
|
|
146
|
-
const externalUrl = unknown ? undefined : target?.url
|
|
147
|
-
const sandboxed = frame.sandboxEnabled
|
|
148
|
-
const addressShortcut = tab.shortcuts?.find(row => row.id === 'browser.address')
|
|
149
|
-
const failure = state?.addressFailure
|
|
150
|
-
const error = frame.error
|
|
151
|
-
const pageUrl = target?.url ?? ''
|
|
152
|
-
const preview = draft.trim() === '' || draft.trim() === pageUrl
|
|
153
|
-
? undefined
|
|
154
|
-
: resolveOmniboxInput(draft, {
|
|
155
|
-
defaultSearchEngineId: startPage.defaultSearchEngineId,
|
|
156
|
-
searchEngines: searchEnginePreferences(startPage),
|
|
157
|
-
applicationOrigin: window.location.origin,
|
|
158
|
-
})
|
|
159
|
-
const previewSearchEngineId = preview?.kind === 'resolved' && preview.primary.kind === 'search'
|
|
160
|
-
? preview.primary.engineId
|
|
161
|
-
: undefined
|
|
162
|
-
const previewEngine = previewSearchEngineId === undefined
|
|
163
|
-
? undefined
|
|
164
|
-
: startPage.engines.find(engine => engine.id === previewSearchEngineId)
|
|
165
|
-
const alternativeSearch = preview?.kind === 'resolved' && preview.alternative?.kind === 'search'
|
|
166
|
-
? preview.alternative
|
|
167
|
-
: undefined
|
|
168
|
-
const submit = (event: FormEvent): void => {
|
|
169
|
-
event.preventDefault()
|
|
170
|
-
const outcome = submitInput(tab.id, draft)
|
|
171
|
-
if (outcome !== undefined) setInitFailure(outcome.ok ? undefined : outcome.reason)
|
|
172
|
-
}
|
|
173
|
-
const openShortcutUrl = (url: string, mode: 'current' | 'new-tab'): void => {
|
|
174
|
-
if (mode === 'new-tab') tab.actions.openTab('browser', { params: { url }, revealIfOpened: false })
|
|
175
|
-
else {
|
|
176
|
-
const outcome = loadUrl(tab.id, url)
|
|
177
|
-
if (outcome !== undefined) setInitFailure(outcome.ok ? undefined : outcome.reason)
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
// A rejected address already has its precise `error.*` notice; showing the
|
|
181
|
-
// generic lifecycle failure next to it would duplicate the same event.
|
|
182
|
-
const reportedInitFailure = initFailure
|
|
183
|
-
?? (state?.initialization?.stage === 'failed' ? state.initialization.reason : undefined)
|
|
184
|
-
// `addressFailure` and `frame.error` already render these two precisely.
|
|
185
|
-
const activeInitFailure = reportedInitFailure === 'navigation-rejected' || reportedInitFailure === 'navigation-failed'
|
|
186
|
-
? undefined
|
|
187
|
-
: reportedInitFailure
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<div className={css.root}>
|
|
191
|
-
<div
|
|
192
|
-
style={{ display: 'contents' }}
|
|
193
|
-
onBlur={(event) => {
|
|
194
|
-
// Keep the hint — and its "search this" button — mounted while Tab
|
|
195
|
-
// moves focus between the address bar and the hint container. Only
|
|
196
|
-
// clear once focus leaves this whole toolbar/hint container.
|
|
197
|
-
const next = event.relatedTarget as Node | null
|
|
198
|
-
if (next !== null && event.currentTarget.contains(next)) return
|
|
199
|
-
setFocused(false)
|
|
200
|
-
}}
|
|
201
|
-
>
|
|
202
|
-
<TakeoverBanner notice={takeover.notice} error={takeover.error}
|
|
203
|
-
label={t('takeover.waiting', { reason: takeover.notice?.reason ?? '' })}
|
|
204
|
-
done={t('takeover.done')} skip={t('takeover.skip')} failure={t('takeover.failed')}
|
|
205
|
-
answer={outcome => { void takeoverChannel.current?.answer(outcome) }} />
|
|
206
|
-
<form className={css.toolbar} onSubmit={submit}>
|
|
207
|
-
<button type="button" className={css.tool} aria-label={t('back')} title={t('back')} disabled={!frame.canGoBack} onClick={() => { goBack(tab.id) }}><IconChevronLeftOutlineRegular /></button>
|
|
208
|
-
<button type="button" className={css.tool} aria-label={t('forward')} title={t('forward')} disabled={!frame.canGoForward} onClick={() => { goForward(tab.id) }}><IconChevronRightOutlineRegular /></button>
|
|
209
|
-
<Tooltip label={t('reload')} shortcutKeys={tab.refreshShortcut?.keys} side="bottom" delayMs={500}>
|
|
210
|
-
<button type="button" className={css.tool} aria-label={t('reload')} aria-keyshortcuts={tab.refreshShortcut?.aria} disabled={target === undefined || mountEpoch === 0} onClick={() => { reload(tab.id) }}><IconRefreshOutlineRegular /></button>
|
|
211
|
-
</Tooltip>
|
|
212
|
-
<SearchEngineMenu data={startPage} t={t} actions={engines} onManage={() => { setEnginesOpen(true) }}
|
|
213
|
-
onFailure={setEngineFailure} />
|
|
214
|
-
<div className={css.addressBox}>
|
|
215
|
-
<input
|
|
216
|
-
ref={addressRef}
|
|
217
|
-
className={[css.address, unknown ? css.addressUnknown : ''].join(' ')}
|
|
218
|
-
value={draft}
|
|
219
|
-
aria-label={t('address.placeholder')}
|
|
220
|
-
aria-keyshortcuts={addressShortcut?.aria}
|
|
221
|
-
title={addressShortcut === undefined ? undefined : t('address.shortcut', { keys: addressShortcut.keys.join(' ') })}
|
|
222
|
-
placeholder={t('address.placeholder')}
|
|
223
|
-
spellCheck={false}
|
|
224
|
-
onChange={(event) => { setDraft(event.currentTarget.value) }}
|
|
225
|
-
onFocus={() => { setFocused(true) }}
|
|
226
|
-
onKeyDown={(event) => {
|
|
227
|
-
if (event.key === 'Escape') {
|
|
228
|
-
event.preventDefault()
|
|
229
|
-
resetDraft()
|
|
230
|
-
event.currentTarget.blur()
|
|
231
|
-
return
|
|
232
|
-
}
|
|
233
|
-
// oxlint-disable-next-line typescript/no-deprecated -- IME 229 covers engines without isComposing.
|
|
234
|
-
if (event.key === 'Enter' && (event.nativeEvent.isComposing || event.keyCode === 229)) event.preventDefault()
|
|
235
|
-
}}
|
|
236
|
-
/>
|
|
237
|
-
{unknown && <span className={css.addressChanged}>{t('address.changed')}</span>}
|
|
238
|
-
<button type="submit" className={[css.tool, css.addressGo].join(' ')} aria-label={t('go')} title={t('go')}><IconLinkOutlineRegular /></button>
|
|
239
|
-
</div>
|
|
240
|
-
<button type="button" className={css.tool} aria-label={t('external')} title={t('external')} disabled={externalUrl === undefined}
|
|
241
|
-
onClick={externalUrl === undefined ? undefined : () => { window.open(externalUrl, '_blank', 'noopener,noreferrer') }}
|
|
242
|
-
><IconRightUpOutlineRegular size={14} /></button>
|
|
243
|
-
{sandboxed !== undefined && <button
|
|
244
|
-
type="button"
|
|
245
|
-
className={[css.tool, sandboxed ? '' : css.sandboxOff].join(' ')}
|
|
246
|
-
aria-label={t(sandboxed ? 'sandbox.disable' : 'sandbox.enable')}
|
|
247
|
-
title={t(sandboxed ? 'sandbox.disable' : 'sandbox.enable')}
|
|
248
|
-
aria-pressed={!sandboxed}
|
|
249
|
-
onClick={() => { setSandbox(tab.id, !sandboxed) }}
|
|
250
|
-
><SandboxPolicyIcon sandboxed={sandboxed} /></button>}
|
|
251
|
-
</form>
|
|
252
|
-
{focused && preview?.kind === 'resolved' && (
|
|
253
|
-
<div className={css.addressHint} role="status">
|
|
254
|
-
<span className={css.addressHintText}>
|
|
255
|
-
{preview.primary.kind === 'search'
|
|
256
|
-
? t('address.searchHint', { engine: previewEngine?.label ?? preview.primary.engineId, query: preview.primary.query })
|
|
257
|
-
: t('address.openHint', { url: preview.primary.target.url })}
|
|
258
|
-
</span>
|
|
259
|
-
{alternativeSearch !== undefined && (
|
|
260
|
-
<button type="button" className={css.addressHintAction}
|
|
261
|
-
onMouseDown={(event) => { event.preventDefault() }}
|
|
262
|
-
onClick={() => { loadUrl(tab.id, alternativeSearch.target.url) }}>
|
|
263
|
-
{t('address.searchThis')}
|
|
264
|
-
</button>
|
|
265
|
-
)}
|
|
266
|
-
</div>
|
|
267
|
-
)}
|
|
268
|
-
{focused && preview?.kind === 'refused' && preview.reason !== 'empty' && (
|
|
269
|
-
<div className={css.addressHint} role="alert">
|
|
270
|
-
<span className={css.addressHintError}>{t(`error.${preview.reason}`)}</span>
|
|
271
|
-
</div>
|
|
272
|
-
)}
|
|
273
|
-
</div>
|
|
274
|
-
{sandboxed === false && <div className={css.sandboxWarning} role="status">{t('sandbox.warning')}</div>}
|
|
275
|
-
{error !== undefined && <div className={css.failure} role="status">{error.code !== undefined && error.description !== undefined
|
|
276
|
-
? t('load.failed.detail', { code: String(error.code), description: error.description })
|
|
277
|
-
: t('load.failed')}</div>}
|
|
278
|
-
{failure !== undefined && <div className={css.failure} role="alert">{t(`error.${failure}`)}</div>}
|
|
279
|
-
{activeInitFailure !== undefined && (
|
|
280
|
-
<div className={css.failure} role="alert" data-init-failure={activeInitFailure}>
|
|
281
|
-
{t(`init.failed.${activeInitFailure}`)}
|
|
282
|
-
</div>
|
|
283
|
-
)}
|
|
284
|
-
{engineFailure !== undefined && <div className={css.failure} role="alert">{t(`error.${engineFailure}`)}</div>}
|
|
285
|
-
<div className={css.content} aria-busy={frame.loading}>
|
|
286
|
-
<div id={viewportId} className={css.viewport} aria-label={t('type.label')} />
|
|
287
|
-
{restoreTarget !== undefined && <section className={css.restore} aria-label={t('restore.previous')}>
|
|
288
|
-
<p className={css.restoreLabel}>{t('restore.previous')}</p>
|
|
289
|
-
<p className={css.restoreTitle}>{restoreTarget.title}</p>
|
|
290
|
-
<p className={css.restoreUrl}>{restoreTarget.url}</p>
|
|
291
|
-
<Button variant="primary" size="sm" disabled={mountEpoch === 0} onClick={() => { restore(tab.id) }}>
|
|
292
|
-
{t('restore.action')}
|
|
293
|
-
</Button>
|
|
294
|
-
</section>}
|
|
295
|
-
{restoreTarget === undefined && target === undefined && !frame.loading && error === undefined && (
|
|
296
|
-
startPage.status === 'ready'
|
|
297
|
-
? <StartPage data={startPage} t={t} actions={shortcuts} open={openShortcutUrl}
|
|
298
|
-
sessionId={sessionId} tabId={tab.id} getTriggerProps={getTriggerProps} />
|
|
299
|
-
: <div className={css.placeholder}>
|
|
300
|
-
<div className={css.start}>{t(startPage.status === 'loading' ? 'startpage.loading' : 'start')}</div>
|
|
301
|
-
</div>
|
|
302
|
-
)}
|
|
303
|
-
{restoreTarget === undefined && frame.loading && error === undefined && <div className={css.placeholder}>
|
|
304
|
-
<div className={css.start}>{t('loading')}</div>
|
|
305
|
-
</div>}
|
|
306
|
-
</div>
|
|
307
|
-
{unknown && <p className={css.limit}>{t('address.unknown')}</p>}
|
|
308
|
-
<EngineSettingsDialog open={enginesOpen} data={startPage} t={t} actions={engines}
|
|
309
|
-
onClose={() => { setEnginesOpen(false) }} />
|
|
310
|
-
<ShortcutDialog open={state?.shortcutDraft !== undefined} shortcut={undefined} seed={state?.shortcutDraft}
|
|
311
|
-
t={t} actions={shortcuts} onClose={() => { dismissShortcut(tab.id) }} />
|
|
312
|
-
</div>
|
|
313
|
-
)
|
|
314
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** The presentation face is separate from page navigation and terminal disposal. */
|
|
2
|
-
export interface BrowserPresentation {
|
|
3
|
-
/**
|
|
4
|
-
* Attach the page inside a committed content container.
|
|
5
|
-
* @param viewportId - content element id; its DOM ancestors must remain connected for page retention.
|
|
6
|
-
* @returns ends physical attachment, without disposing the navigation model; a later mount may reload the page.
|
|
7
|
-
*/
|
|
8
|
-
mount(viewportId: string): () => void
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Live Browser tab title from the Browser store. */
|
|
2
|
-
import type { ReactNode } from 'react'
|
|
3
|
-
import { IconGlobeOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
4
|
-
import type { PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots'
|
|
5
|
-
import { currentBrowserTarget } from '../browser/BrowserPersistence.ts'
|
|
6
|
-
import type { BrowserStore } from '../browser/store.ts'
|
|
7
|
-
import css from './Browser.module.css'
|
|
8
|
-
|
|
9
|
-
/** Browser title props assembled by the Sidebar title seat. */
|
|
10
|
-
export type BrowserTitleProps = PropsRuntime<'sidebar.right.pane.tab.title'> & PropsStore<BrowserStore>
|
|
11
|
-
|
|
12
|
-
/** Browser icon and current host name. */
|
|
13
|
-
export function BrowserTitle({ useTabInfo, useStore }: BrowserTitleProps): ReactNode {
|
|
14
|
-
const { tab } = useTabInfo()
|
|
15
|
-
const entry = useStore(state => currentBrowserTarget(state.byTab[tab.id]))
|
|
16
|
-
return <><IconGlobeOutlineRegular className={css.titleIcon} />{entry?.title ?? tab.title}</>
|
|
17
|
-
}
|