jonroig / mailtowa Goto Github PK
View Code? Open in Web Editor NEWChrome extension, opens mailto: links by default in by Microsoft Office 365 / Outlook Web Application (OWA)
Chrome extension, opens mailto: links by default in by Microsoft Office 365 / Outlook Web Application (OWA)
Hello, thanks for this extension.
Have you considered using a custom protocol handler instead of injecting a script on every page?
Would it be a feasible option?
https://developers.google.com/web/updates/2011/06/Registering-a-custom-protocol-handler
The extension does not work from some websites, mailto redirects to a third party messaging application. Works well since your Github test.
The new Fluent UI 9 React OWA uses the following route for external mailto
requests:
`${BASE_URI}/mail/deeplink/compose?mailtouri=${MAILTO_URI}`
Where $BASE_URI
is usually https://outlook.office365.com
and $MAILTO_URI
the full mailto:
URI.
The existing route works, but you may wish to update in case it becomes deprecated.
I pulled this by stepping through the OWA source via debugger.
I'm determined to help get this working. Running Chrome Version 81.0.4044.122 (Official Build) (64-bit) on Linux Mint 19.3 Cinnamon. I use Office 365 webapps for everything except powerpoint and Excel which I run in a VM.
It definitely worked on the outlook.office.com tab but it opened links in a new tab which isn't ideal. OWA by default creates new emails from mailto links clicked while in OWA, in the same tab.
The behaviour I'm seeing is that (outside of the OWA tab), clicking a mailto link opens a new tab for the briefest moment which then disappears. I checked the preferred mail client which was KMailService. I changed this to Chrome. Clicking a mailto link then just opens a new empty Chrome tab in a new Chrome instance.
Any suggestions?
With Chrome 79.0.3945.88 on MacOS Catalina 10.15.2, the extension correctly opens links in OWA but it does not cancel the default behaviour so I get 2 compose windows:
Both windows have the same content.
I only installed the extension today so haven't checked any other versions.
Looks like the call to e.preventDefault()
is not working.
The addon doesn't work on the links I use on one of my pages (on the intranet) which contain svg icons. I got the minimal example below:
<a href="mailto:[email protected]&subject=Example" title="Create an empty email addressed to everyone in this section">
<svg class="MuiSvgIcon-root" focusable="false" viewBox="0 0 24 24" aria-hidden="true" role="presentation">
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"></path>
</svg>
</a>
I stipped down all classes except this one:
.MuiSvgIcon-root {
fill: currentColor;
width: 1em;
height: 1em;
display: inline-block;
font-size: 1.5rem;
transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
flex-shrink: 0;
user-select: none;
}
As soon as I replace the inner HTML with a text, it works.
This code is always executed for mailto:
links:
Lines 18 to 21 in 60caaab
Fetching the config value from chrome.storage.sync
is inherently asynchronous, so I know it is difficult to fetch the config value and use it in a condition skipping those lines of code, if the user setting is "off"
, but this could be fixed by caching the configuration locally, also making sure that the cache is getting refreshed, using an event handler reacting to changes in chrome.storage.sync
. I do not speak JS at all, but I think this is the way you handle such things in a language like this, trying to escape the infamous callback hell.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.