Error using mailto: link in Mobile Safari in app mode

I have a form on a web page with an action that is "mailto: email" (where email is the real email address). When I load this page in Mobile Safari in normal mode (i.e., it does not start from the home screen with a mode that supports applications), this works fine - after I submit the form, an email application will appear. However, when I work in application mode and start from the main screen (for example, without the Safari chronicle), and submit the form, I get an error message "URL could not be shown." However, regular mailto: mail: link (i.e., not in form) works in a mode suitable for applications.

Has anyone else noticed this? Any workarounds? Are forms forbidden in application support mode?

Thanks,

Elizabeth

+4
source share
4 answers

This accurately describes the problem. There is nothing wrong with the mailto link; the mailto link is not loading. Webapp crashes often.

The funny thing is that the phone: the connection for phone numbers is working fine.

window.location.replace really works. Thanks!

Here is jQuery to fix this automatically ...

$('a[href^=mailto]').click(function (event) { event.preventDefault(); window.location.replace = $(this).attr('href'); return false; }); 
+1
source

I think I figured it out. I noticed that in the mode that supports the application, any HTTP link will take you out of the application and launch a separate mobile safari window, lead you to the page and show the Safari hard. It makes sense (as a rule, no one contacts any of the all-in-one web applications that support the application. I noticed this because I implemented the 4-page application with my own tab bar below and linked. Html files with simple HTTP links in the element.When I replace this with a javascript function to load pages using document.location.replace, this does not happen.

So, in the form - I think that should happen because I use the scheme (in this case mailto :), anyway the browser is needed in "normal mode" to interpret the scheme and do the right thing that launches the email application, and this obviously does not work when submitting the form. I have not found anything in the Apple documentation about this yet, so if anyone knows the technical details, please send messages!

UPDATE: I found that I can access the server side of the script using a form in web application mode, so I'm still interested to know about the mailto: issue problem if anyone has an answer.

Thanks,

Elizabeth

0
source

I have the same problem when mailto links do not work in web compatibility mode. I just finished submitting an Apple bug report. Let's see what happens while I find another developer. a web application platform that works in web compatibility mode and works with mailto links, but it’s funny how it even works - it’s not as difficult as it is in Safari. Because even in this new web developer tool that I found, it closes your application and launches the mail client, which is lame. In Safari, it just slides in the mail box, which slips away if you press cancel or send - in fact, this does not close your application.

0
source

Here is a workaround that is independent of jQuery:

 aTmp = document.createElement("a"); aTmp.href="mailto: example@example.com ?subject=Test&body=Hello."; aTmp.click(); 

Update. To run this code from the bookmarklet, you need to wait about 1000 ms until the bookmark frame is closed and the browser is ready to respond. I figured this out by wrapping the code in the setTimeout function.

0
source

All Articles