Page 1 of 1

problem with mailto:

Posted: Sun Jul 12, 2020 9:50 am
by donatop
Hi,
i have written a program with a CEFApplication inside. The program shows a page from a wordpress blog. Everythings works well except for a "mailto:" problem.
Inside the blog (https://www.winxpalnews.it/wp) i have several links to "mailto:...."
if i show the blog from standard browser like Chrome or Firefox, a click to the "mailto" URL works well and a call to the local (local of the computer) application for the mail (like Outlook or Thunderbird) is correctly done and a window is opened (see figure 1)
instead if i open the blog from my program clicks to the URL results in a blank page (see figure 2)

Thanks in advance. Donato.

Re: problem with mailto:

Posted: Sun Jul 12, 2020 10:46 am
by salvadordf
Hi,

It's a known CEF issue :
https://bitbucket.org/chromiumembedded/ ... lank-after

Try using the TChromium.OnBeforeBrowse event to call ShellExecute in case the URL scheme is "mailto".

Re: problem with mailto:

Posted: Wed Jul 22, 2020 2:47 pm
by donatop
Thanks, but i have read the CEF Issue, but i don't have understood how to call GetURL from Delphi, unfortunately the example is in C++.

Re: problem with mailto:

Posted: Wed Jul 22, 2020 4:28 pm
by salvadordf
In this case, you would have to read the "request.url" Delphi property instead of calling "request->GetURL()".

The last comment in that issue states that you would have to search the "mailto:" substring inside the request.url value. If you find that value then you call "browser.stopload", set "allow_os_execution" to False and then call the ShellExecute function to let Windows run the default email client in that machine.

Re: problem with mailto:

Posted: Fri Jul 24, 2020 2:16 pm
by donatop
Thank you. Issue resolved.