fix: open links externally in Quick CSS editor (#1487)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Ryan Cao 2023-08-05 02:13:53 +08:00 committed by GitHub
parent 885ad134b3
commit 21318850b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View file

@ -31,6 +31,7 @@ import monacoHtml from "~fileContent/../components/monacoWin.html;base64";
import { getThemeInfo, stripBOM, UserThemeHeader } from "./themes";
import { ALLOWED_PROTOCOLS, QUICKCSS_PATH, SETTINGS_DIR, SETTINGS_FILE, THEMES_DIR } from "./utils/constants";
import { makeLinksOpenExternally } from "./utils/externalLinks";
mkdirSync(SETTINGS_DIR, { recursive: true });
mkdirSync(THEMES_DIR, { recursive: true });
@ -143,5 +144,8 @@ ipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {
sandbox: false
}
});
makeLinksOpenExternally(win);
await win.loadURL(`data:text/html;base64,${monacoHtml}`);
});