- Copy this script line, and add it to a bookmark as the URL paramenter:
javascript:(async function(){try{messageId=document.querySelector('div[data-legacy-message-id]').getAttribute('data-legacy-message-id');user=location.pathname.match(/\/u\/(\d)/)[1];await navigator.clipboard.writeText('https://mail.google.com/mail/u/'+user+'/#all/'+messageId)}catch(e){console.error(e)}})()
- Open any email, click the bookmark, and the direct link is copied to your clipboard.
This is helpful! Any way to extract the full email and replace the u/1, u/2, etc. with the actual email? Trying to save links to emails in my notes app, but the u number is different on different computers.
Edit, looks like this fork may do it: https://gist.github.com/daniel-barrows/93864da22cc017723a344b684f38fbb5