Right click to send e-mail
-
AudunNilsen last edited by
Hi
I want to be able to double click on an e-mail address, so it´s highlighted, then right click, and "Send e-mail", preferably with Gmail, or Hotmail.
What do you guys use?
Thanks
-
burnout426 Volunteer last edited by
You can do a little trick.
Goto the URL
opera://settings/searchEngines
, click "Add", TypeCompose
for the name,c
for the shortcut (or whatever you want) andmailto:%s
for the URL. Then, click add.Then, when you double-left-click the text (not a link) of
test@example.com
for example on a page, you can right-click the selection, goto "Search with" and choose "Compose".That will cause
mailto:test@example.com
to launch in a new tab where Opera will then launch the mailto URL in the default mail client on the system. However, if you allow mail.google.com to handle mailto links (where you see an entry for it at the URLopera://settings/handlers
), instead of the default mail client on the system, it will open up a Gmail compose page in a tab in Opera with test@example.com in the To field.You can goto the URL
data:text/plain,test%40example.com
to test it.If, Gmail never asks you to handle mailto links, see https://reddit.com/r/operabrowser/comments/1ctpnxs/comment/l4f4wnt/?utm_source=reddit&utm_medium=web2x&context=3 for how to trigger it manually.
Besides that, you probably really want an extension that uses the chrome.contextMenus API with the "selection" context to add an item to the right-click menu for selections that then does what you want when you click it. I don't know if there are any existing extensions that do that or not.
-
burnout426 Volunteer last edited by
Here's a demo extension that will do what you want for Gmail.
Create a folder named "Send to" on your desktop.
In the folder, put these 2 files (that you create in a text editor):
manifest.json:
{ "manifest_version": 3, "name": "Send to with Gmail", "version": "1.0", "permissions": [ "contextMenus" ], "background": { "service_worker": "background.js" } }
background.js:
chrome.runtime.onInstalled.addListener(() => { chrome.contextMenus.create({ id: "sampleContextMenu", title: "Send to with Gmail", contexts: ["selection"] }); }); chrome.contextMenus.onClicked.addListener((info, tab) => { if (info.menuItemId === "sampleContextMenu") { const selectedText = info.selectionText; if (selectedText.includes("@")) { const mailto_url = "mailto:" + encodeURIComponent(selectedText); const url = "https://mail.google.com/mail/?extsrc=mailto&url=" + encodeURIComponent(mailto_url); chrome.tabs.create({url: url}); } else { const error_message = "data:text/plain;charset=utf-8," + encodeURIComponent('"' + selectedText + '" does not seem to be an email address.'); chrome.tabs.create({url: error_message}); } } });
Then, in Opera, goto the URL
opera://extensions
, turn on developer mode, click "load unpacked" and point it to the "Send to" folder on your desktop.Then, when you hightlight a plain text email address on a page and right-click the selection, there will be a "Send to with Gmail" option in the context menu that you can click.
You can of course edit the name of the extension and the name of the context menu item etc., but that should get your started.