mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-09-15 22:32:04 +02:00
Confirm proxy use before the first web request (#657)
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
@@ -124,6 +124,7 @@ export function createTauriPlatform(): Platform {
|
||||
|
||||
return {
|
||||
capabilities: ALL_CAPABILITIES,
|
||||
httpProxyUrl: null,
|
||||
window,
|
||||
|
||||
clipboard: {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user