Closed kalkwarf closed 2 years ago
Hi! Thanks for the patch.
I think a better way may be to check the current URL perhaps? For example, when viewing a mail,
it looks something like this: https://www.fastmail.com/mail/Inbox/{mail-id}
, but when replying to one, it's https://www.fastmail.com/mail/Inbox/compose/{mail-id}
. Would this give you enough safety checks to know when to run the shortcuts?
Another idea is to somehow override the Fastmail bindings. In their source code they have this inside mail.mod.js
:
Uo = {
r: "reply",
a: "replyAll",
"Alt-r": "replySender",
f: "forward",
n: "goNext",
p: "goPrevious",
e: "toggleExpand",
s: "toggleFlagged",
'"': "toggleQuotes",
":": "toggleDetails",
";": "showActions",
"Shift-E": "expandAll",
"Alt-Shift-E": "collapseAll",
"Shift-L": "showRemoteImages",
"Cmd-a": "selectMessageBody"
},
perhaps one could extend it and simply add the arrow shortcuts there. But I think the URL approach is simpler
The DOM changed with the latest UI refresh, so I updated the handlers to look for the new IDs.
A: This is fragile. There must be a better way. B: The fact that we assure the document looks like we expected means we failed safely, so there's that.