Path: blob/main/components/supervisor/frontend/src/shared/loading-frame.ts
2501 views
/**1* Copyright (c) 2020 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { FrontendDashboardServiceClient } from "./frontend-dashboard-service";7import { startUrl } from "./urls";89export function load(): Promise<{10frame: HTMLIFrameElement;11frontendDashboardServiceClient: FrontendDashboardServiceClient;12}> {13return new Promise((resolve) => {14const frame = document.createElement("iframe");15frame.src = startUrl.toString();16frame.style.visibility = "visible";17frame.className = "gitpod-frame loading";18frame.allow = "clipboard-write"19document.body.prepend(frame);2021frame.onload = () => {22const frontendDashboardServiceClient = new FrontendDashboardServiceClient(frame.contentWindow!);23resolve({ frame, frontendDashboardServiceClient });24};25});26}272829