mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
save work
This commit is contained in:
parent
be37916ca6
commit
406afe4a4f
@ -5,14 +5,14 @@
|
||||
<base href="../" />
|
||||
<script charset="UTF-8" src="dist-dev/waveterm.js"></script>
|
||||
<link rel="stylesheet" href="public/bulma-0.9.4.min.css" />
|
||||
<link rel="stylesheet" href="public/fontawesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="public/fontawesome/css/brands.min.css">
|
||||
<link rel="stylesheet" href="public/fontawesome/css/solid.min.css">
|
||||
<link rel="stylesheet" href="public/fontawesome/css/sharp-solid.min.css">
|
||||
<link rel="stylesheet" href="public/fontawesome/css/sharp-regular.min.css">
|
||||
<link rel="stylesheet" href="public/fontawesome/css/fontawesome.min.css" />
|
||||
<link rel="stylesheet" href="public/fontawesome/css/brands.min.css" />
|
||||
<link rel="stylesheet" href="public/fontawesome/css/solid.min.css" />
|
||||
<link rel="stylesheet" href="public/fontawesome/css/sharp-solid.min.css" />
|
||||
<link rel="stylesheet" href="public/fontawesome/css/sharp-regular.min.css" />
|
||||
<link rel="stylesheet" href="dist-dev/waveterm.css" />
|
||||
|
||||
<link rel="stylesheet" id="theme-stylesheet" href="public/themes/default.css">
|
||||
<link rel="stylesheet" id="theme-stylesheet" href="public/themes/default.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="measure"></div>
|
||||
|
@ -352,7 +352,6 @@ function createMainWindow(clientData: ClientDataType | null): Electron.BrowserWi
|
||||
const indexHtml = isDev ? "index-dev.html" : "index.html";
|
||||
win.loadFile(path.join(getElectronAppBasePath(), "public", indexHtml));
|
||||
win.webContents.on("before-input-event", (e, input) => {
|
||||
const waveEvent = adaptFromElectronKeyEvent(input);
|
||||
if (win.isFocused()) {
|
||||
wasActive = true;
|
||||
}
|
||||
@ -380,7 +379,7 @@ function createMainWindow(clientData: ClientDataType | null): Electron.BrowserWi
|
||||
win.webContents.on("zoom-changed", (e) => {
|
||||
win.webContents.send("zoom-changed");
|
||||
});
|
||||
win.webContents.setWindowOpenHandler(({ url, frameName }) => {
|
||||
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (url.startsWith("https://docs.waveterm.dev/")) {
|
||||
console.log("openExternal docs", url);
|
||||
electron.shell.openExternal(url);
|
||||
@ -401,6 +400,19 @@ function createMainWindow(clientData: ClientDataType | null): Electron.BrowserWi
|
||||
return { action: "deny" };
|
||||
});
|
||||
|
||||
electron.session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
callback({
|
||||
responseHeaders: {
|
||||
...details.responseHeaders,
|
||||
"Content-Security-Policy": [
|
||||
`default-src 'file://${getElectronAppBasePath()}/dist${isDev ? "-dev" : ""}/'`,
|
||||
`script-src 'file://${getElectronAppBasePath()}/dist${isDev ? "-dev" : ""}/'`,
|
||||
`style-src 'file://${getElectronAppBasePath()}/dist${isDev ? "-dev" : ""}/'`,
|
||||
],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user