|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= <loic@coderpad.io> |
| 3 | +Date: Mon, 11 Aug 2025 08:43:30 +0200 |
| 4 | +Subject: [PATCH] fixup! feat: support loading VSCode in an iframe |
| 5 | + |
| 6 | +--- |
| 7 | + src/vs/workbench/browser/window.ts | 4 ++-- |
| 8 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 9 | + |
| 10 | +diff --git a/src/vs/workbench/browser/window.ts b/src/vs/workbench/browser/window.ts |
| 11 | +index 74ed21bbfeb..44678fae826 100644 |
| 12 | +--- a/src/vs/workbench/browser/window.ts |
| 13 | ++++ b/src/vs/workbench/browser/window.ts |
| 14 | +@@ -111,7 +111,7 @@ export abstract class BaseWindow extends Disposable { |
| 15 | + |
| 16 | + function getOverridenWindow(targetWindow: Window) { |
| 17 | + if (targetWindow === mainWindow) { |
| 18 | +- // If running inside an iframe, do not override the `setTimeout` function on the |
| 19 | ++ // If running inside an iframe, do not override the `setTimeout` function on the main frame |
| 20 | + // eslint-disable-next-line no-restricted-globals |
| 21 | + return window; |
| 22 | + } |
| 23 | +@@ -167,7 +167,7 @@ export abstract class BaseWindow extends Disposable { |
| 24 | + return timeoutHandle; |
| 25 | + }; |
| 26 | + |
| 27 | +- targetWindow.clearTimeout = function (this: unknown, timeoutHandle: number | undefined): void { |
| 28 | ++ getOverridenWindow(targetWindow).clearTimeout = function (this: unknown, timeoutHandle: number | undefined): void { |
| 29 | + const timeoutDisposables = typeof timeoutHandle === 'number' ? BaseWindow.TIMEOUT_DISPOSABLES.get(timeoutHandle) : undefined; |
| 30 | + if (timeoutDisposables) { |
| 31 | + dispose(timeoutDisposables); |
0 commit comments