diff --git a/src/browser/client.ts b/src/browser/client.ts index f21b4708..cf560c79 100644 --- a/src/browser/client.ts +++ b/src/browser/client.ts @@ -5,6 +5,7 @@ import { Extensions, IConfigurationRegistry } from "vs/platform/configuration/co import { registerSingleton } from "vs/platform/instantiation/common/extensions"; import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection"; import { ILocalizationsService } from "vs/platform/localizations/common/localizations"; +import { INotificationService, Severity } from "vs/platform/notification/common/notification"; import { Registry } from "vs/platform/registry/common/platform"; import { PersistentConnectionEventType } from "vs/platform/remote/common/remoteAgentConnection"; import { ITelemetryService } from "vs/platform/telemetry/common/telemetry"; @@ -85,6 +86,27 @@ export const initialize = async (services: ServiceCollection): Promise => (event as any).ide = target.ide; (event as any).vscode = target.vscode; window.dispatchEvent(event); + + if (!window.isSecureContext) { + (services.get(INotificationService) as INotificationService).notify({ + severity: Severity.Warning, + message: "code-server is being accessed over an insecure domain. Some functionality may not work as expected.", + actions: { + primary: [{ + id: "understand", + label: "I understand", + tooltip: "", + class: undefined, + enabled: true, + checked: true, + dispose: () => undefined, + run: () => { + return Promise.resolve(); + } + }], + } + }); + } }; export interface Query {