mirror of
https://github.com/danog/code-server.git
synced 2024-11-27 12:57:13 +01:00
Fix window.open infinite loop
This commit is contained in:
parent
bbd8b27fc7
commit
94b8b9a5cf
@ -10,6 +10,15 @@ import { client } from "../client";
|
||||
import { showOpenDialog } from "../dialog";
|
||||
import { workbench } from "../workbench";
|
||||
|
||||
// VS Code overrides window.open to call openExternal, but we then call
|
||||
// window.open which results in an infinite loop. Store the function but also
|
||||
// make it unable to be set (doesn't work otherwise).
|
||||
const windowOpen = window.open;
|
||||
Object.defineProperty(window, "open", {
|
||||
set: (): void => { /* Not allowed. */ },
|
||||
get: (): Function => windowOpen,
|
||||
});
|
||||
|
||||
/**
|
||||
* Instead of going to the shared process, we'll directly run these methods on
|
||||
* the client. This setup means we can only control the current window.
|
||||
|
Loading…
Reference in New Issue
Block a user