Skip to content

Build your personal knowledge base with Trilium Notes

Make attachments open in a new tab/browser

SiriusXTd2ee3738a2e6
diff --git a/src/public/app/widgets/type_widgets/abstract_text_type_widget.js b/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
index e786873560..92409eb1a1 100644
--- a/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
+++ b/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
@@ -32,7 +32,7 @@ export default class AbstractTextTypeWidget extends TypeWidget {
async openImageInCurrentTab($img) {
const { noteId, viewScope } = await this.parseFromImage($img);
-
+
if (noteId) {
appContext.tabManager.getActiveContext().setNote(noteId, { viewScope });
} else {
@@ -40,8 +40,8 @@ export default class AbstractTextTypeWidget extends TypeWidget {
}
}
- openImageInNewTab($img) {
- const { noteId, viewScope } = this.parseFromImage($img);
+ async openImageInNewTab($img) {
+ const { noteId, viewScope } = await this.parseFromImage($img);
if (noteId) {
appContext.tabManager.openTabWithNoteWithHoisting(noteId, { viewScope });
diff --git a/src/services/window.ts b/src/services/window.ts
index dd64aeb009..d0c625a15b 100644
--- a/src/services/window.ts
+++ b/src/services/window.ts
@@ -111,13 +111,9 @@ async function createMainWindow(app: App) {
}
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
- if (!mainWindow) {
- return;
- }
-
remoteMain.enable(webContents);
- mainWindow.webContents.setWindowOpenHandler((details) => {
+ webContents.setWindowOpenHandler((details) => {
async function openExternal() {
(await import('electron')).shell.openExternal(details.url);
}