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