mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
08c66696f8
commit
4116583c15
8 changed files with 52 additions and 2 deletions
|
|
@ -368,7 +368,7 @@ const initMainWindow = () => {
|
|||
|
||||
if (-1 < details.url.toLowerCase().indexOf("youtube")) {
|
||||
// YouTube 设置 Referer https://github.com/siyuan-note/siyuan/issues/16319
|
||||
details.requestHeaders["Referer"] = 'https://b3log.org/siyuan/';
|
||||
details.requestHeaders["Referer"] = "https://b3log.org/siyuan/";
|
||||
cb({requestHeaders: details.requestHeaders});
|
||||
return;
|
||||
}
|
||||
|
|
@ -1048,6 +1048,25 @@ app.whenReady().then(() => {
|
|||
ipcMain.on("siyuan-quit", (event, port) => {
|
||||
exitApp(port);
|
||||
});
|
||||
ipcMain.on("siyuan-reload-window", (event, port) => {
|
||||
BrowserWindow.getAllWindows().forEach((item) => {
|
||||
try {
|
||||
const currentURL = new URL(item.getURL());
|
||||
if (port.toString() === currentURL.port.toString()) {
|
||||
const hasMain = workspaces.find((workspaceItem) => {
|
||||
if (workspaceItem.browserWindow.id === item.id) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!hasMain) {
|
||||
item.reload();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// load file is not a url
|
||||
}
|
||||
});
|
||||
});
|
||||
ipcMain.on("siyuan-show-window", (event) => {
|
||||
const mainWindow = getWindowByContentId(event.sender.id);
|
||||
if (!mainWindow) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue