Add insecure access notification
This commit is contained in:
parent
d97feca3ba
commit
1474a82c7d
1 changed files with 22 additions and 0 deletions
|
@ -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<void> =>
|
|||
(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 {
|
||||
|
|
Loading…
Reference in a new issue