mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
aa5acf39cf
commit
f600cc1bde
4 changed files with 31 additions and 29 deletions
|
|
@ -705,17 +705,26 @@ app.whenReady().then(() => {
|
|||
let webContentsId = event.sender.id
|
||||
if (typeof data !== "string") {
|
||||
cmd = data.cmd;
|
||||
webContentsId = data.webContentsId
|
||||
if (data.webContentsId) {
|
||||
webContentsId = data.webContentsId
|
||||
}
|
||||
}
|
||||
const currentWindow = getWindowByContentId(webContentsId);
|
||||
switch (cmd) {
|
||||
case "openDevTools":
|
||||
event.sender.openDevTools({mode: "bottom"});
|
||||
break;
|
||||
case "show":
|
||||
showWindow(getWindowByContentId(webContentsId));
|
||||
showWindow(currentWindow);
|
||||
break;
|
||||
case "hide":
|
||||
getWindowByContentId(webContentsId).hide();
|
||||
currentWindow.hide();
|
||||
break;
|
||||
case "focus":
|
||||
currentWindow.focus();
|
||||
break;
|
||||
case "clearCache":
|
||||
event.sender.session.clearCache();
|
||||
break;
|
||||
case "redo":
|
||||
event.sender.redo();
|
||||
|
|
@ -724,7 +733,14 @@ app.whenReady().then(() => {
|
|||
event.sender.undo();
|
||||
break;
|
||||
case "destroy":
|
||||
getWindowByContentId(webContentsId).destroy();
|
||||
currentWindow.destroy();
|
||||
break;
|
||||
case "setProxy":
|
||||
event.sender.session.closeAllConnections().then(() => {
|
||||
event.sender.session.setProxy({proxyRules: data.proxyURL}).then(() => {
|
||||
console.log("network proxy [" + data.proxyURL + "]");
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue