Confirm proxy use before the first web request (#657)

This commit is contained in:
Gregory Schier
2026-09-14 21:29:07 -07:00
committed by GitHub
parent fd95b4cba3
commit ff5db718ce
9 changed files with 275 additions and 1 deletions
+3
View File
@@ -34,6 +34,9 @@ function host(): Platform {
* and cannot be made to wait.
*/
export const platform: Platform = {
get httpProxyUrl() {
return host().httpProxyUrl;
},
get capabilities() {
return host().capabilities;
},
+1
View File
@@ -124,6 +124,7 @@ export function createTauriPlatform(): Platform {
return {
capabilities: ALL_CAPABILITIES,
httpProxyUrl: null,
window,
clipboard: {
+2
View File
@@ -186,6 +186,8 @@ export interface PlatformBlobs {
export interface Platform {
readonly capabilities: PlatformCapabilities;
/** Web request relay, or null when this host executes requests itself. */
readonly httpProxyUrl: string | null;
readonly window: PlatformWindow;
readonly clipboard: PlatformClipboard;
readonly dialog: PlatformDialog;
+2
View File
@@ -28,6 +28,7 @@ import type {
import { commandSupport, runCommand } from "./commands";
import { WorkerConnection } from "./connection";
import { unsupported } from "./errors";
import { serverBaseUrl } from "./server";
import { requestPersistence } from "./storage";
/** What this host can do, reported honestly. */
@@ -177,6 +178,7 @@ export function createWebPlatform(): Platform {
return {
capabilities,
httpProxyUrl: serverBaseUrl() || window.location.origin,
window: createWindow(db),
clipboard: {