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