This commit is contained in:
Vanessa 2023-03-29 09:12:04 +08:00
parent 42dc3712c1
commit ddfaf6bdba
5 changed files with 27 additions and 4 deletions

View file

@ -124,6 +124,9 @@ const openFile = (options: IOpenFileOptions) => {
if ((jsonObj.children.rootId && jsonObj.children.rootId === options.rootID) ||
(jsonObj.children.path && jsonObj.children.path === options.assetPath)) {
item.focus();
if (options.assetPath) {
item.webContents.executeJavaScript(`window.newWindow.positionPDF("${options.assetPath}", ${typeof options.page === "number" ? options.page : `"${options.page}"`})`);
}
hasOpen = true;
return true;
}