mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-22 16:24:11 +01:00
Confirm proxy use before the first web request (#657)
This commit is contained in:
1 parent
fd95b4cba3
commit
ff5db718ce
9 files changed
+275
-1
No files matched your search
@@ -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