shortkeys icon indicating copy to clipboard operation
shortkeys copied to clipboard

Delete key for Gmail

Open qwik3r opened this issue 4 years ago • 3 comments

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

qwik3r avatar Mar 12 '21 20:03 qwik3r

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.

harl avatar May 07 '21 00:05 harl

You could try the Gmail API.

TheCodingKerbal avatar Dec 29 '21 01:12 TheCodingKerbal

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*:

image

So I suppose it doesn't work because it is simply not active in the correct part of the page.

radeklat avatar Apr 05 '24 12:04 radeklat