From 1179d9d80a5623f2ad0e92ff135de5c1899f5b0a Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Thu, 9 May 2024 21:19:58 +0200 Subject: [PATCH] webmail: when opening message in new tab, set document title to subject, message from address(es) and id of message --- webmail/msg.js | 1 + webmail/msg.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/webmail/msg.js b/webmail/msg.js index b0412db..0948bb2 100644 --- a/webmail/msg.js +++ b/webmail/msg.js @@ -1391,6 +1391,7 @@ const loadMsgheaderView = (msgheaderelem, mi, moreHeaders, refineKeyword, allAdd // Javascript is generated from typescript, do not modify generated javascript because changes will be overwritten. const init = () => { const mi = api.parser.MessageItem(messageItem); + document.title = '"' + mi.Envelope.Subject + '"- from ' + ((mi.Envelope.From || []).map(a => formatAddress(a)).join(', ') || '-') + ' (id ' + mi.Message.ID + ')'; let msgattachmentview = dom.div(); if (mi.Attachments && mi.Attachments.length > 0) { dom._kids(msgattachmentview, dom.div(css('msgAttachments', { borderTop: '1px solid', borderTopColor: styles.borderColor }), dom.div(dom._class('pad'), 'Attachments: ', join(mi.Attachments.map(a => a.Filename || '(unnamed)'), () => ', ')))); diff --git a/webmail/msg.ts b/webmail/msg.ts index 9204007..b690969 100644 --- a/webmail/msg.ts +++ b/webmail/msg.ts @@ -5,6 +5,7 @@ declare let messageItem: api.MessageItem const init = () => { const mi = api.parser.MessageItem(messageItem) + document.title = '"' + mi.Envelope.Subject + '"- from '+((mi.Envelope.From || []).map(a => formatAddress(a)).join(', ') || '-') + ' (id '+mi.Message.ID+')' let msgattachmentview = dom.div() if (mi.Attachments && mi.Attachments.length > 0) {