Merge pull request #559 from TriliumNext/siriusxt-test

Make attachments open in a new tab/browser
This commit is contained in:
Elian Doran 2024-11-07 22:22:42 +02:00 committed by GitHub
commit b5988ba7c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 8 deletions

View File

@ -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 });

View File

@ -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);
}