Delete key for Gmail
Is there anyway to trigger the delete command for a message in Gmail? I tried mapping backspace to shift+3 (and shift+#, and just #) but it didn't seem to work
Ordinarily to delete a message in Gmail it's just "#" (but you have to do shift+3).
Thanks
I'd think that you'd have to execute a specific script that the Gmail page provides.
Eventually, the function may need to be hooked first and adapted to your needs (for example if you wanted it to be able to delete more than one selected email thread simultaneously). Also, it would need to be limited to the Gmail site, as you probably wouldn't want the backspace key to accidentally execute unexpected code on other sites.
I don't use Gmail myself, so I don't know this well enough to provide actual code.
You could try the Gmail API.
I was after the same thing. I also tried custom JavaScript, targeting the aria label with document.querySelector('[aria-label="Delete"]').click(). It kept reporting that the element does not exist (while it did work in the developers console). So I tried to target just any div to see, if querySelector works at all. What I got back was a div from chat.google.com (even though I had it set to target only *mail.google.com*:
So I suppose it doesn't work because it is simply not active in the correct part of the page.