Skip to content

Commit fc2af3d

Browse files
committed
Try to replace CSS visibility with HTML hidden
This is testing for a fix for Safari, in which Safari does not respect `visibility: hidden` on our `<iframe>`
1 parent a0468ca commit fc2af3d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

components/supervisor/frontend/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ const ideService = IDEFrontendService.create();
6464
const loadingIDE = new Promise((resolve) => window.addEventListener("DOMContentLoaded", resolve, { once: true }));
6565
const toStop = new DisposableCollection();
6666

67-
document.body.style.visibility = "hidden";
6867
LoadingFrame.load().then(async (loading) => {
6968
const frontendDashboardServiceClient = loading.frontendDashboardServiceClient;
7069
await frontendDashboardServiceClient.initialize();
@@ -162,8 +161,8 @@ LoadingFrame.load().then(async (loading) => {
162161
if (current === newCurrent) {
163162
return;
164163
}
165-
current.style.visibility = "hidden";
166-
newCurrent.style.visibility = "visible";
164+
current.hidden = true;
165+
newCurrent.hidden = false;
167166
if (current === document.body) {
168167
while (document.body.firstChild && document.body.firstChild !== newCurrent) {
169168
document.body.removeChild(document.body.firstChild);

components/supervisor/frontend/src/shared/loading-frame.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function load(): Promise<{
1414
return new Promise((resolve) => {
1515
const frame = document.createElement("iframe");
1616
frame.src = startUrl.toString();
17-
frame.style.visibility = "visible";
17+
frame.hidden = false;
1818
frame.className = "gitpod-frame loading";
1919
document.body.appendChild(frame);
2020

0 commit comments

Comments
 (0)