OpenURL doesn't support mailto:

Archives Forums/BlitzMax Bug Reports/OpenURL doesn't support mailto:

ima747(Posted 2010) [#1]
OpenURL() adds http:// to the front of the url you pass it unless it already contains http or https, which means it can only be used for web addresses. The documentation says it will just pass your url string to the system's default web browser which would then handle things like mailto: as it will know how to parse that. I recall this used to work (passing a mailto: that is).

Looking at the history it looks like it was changed in 1.17 Release, trying to qualify the URL.

My solution is to change
brl.mod/system.mod/system.bmx
line 264
to
If dev<>"http:" And dev<>"file:" And url[..6].ToLower()<>"https:" And url[..7].ToLower()<>"mailto:"
just telling it to no bother parsing mailto: the same way it ignores https. This seems to work fine on mac and windows, don't have a linux setup to test.

of note the current implementation doesn't support true URLs since it attempts to correct everything to a web address. Special exceptions will need to be written in for ftp, etc. just like mailto...


GfK(Posted 2010) [#2]
Its not really a bug. OpenURL() does some prefix checks for http: and the like.

You can bypass all that by calling driver.OpenUrl() instead. That way it'll attempt to open any URL you throw at it.


ima747(Posted 2010) [#3]
good to know, but having to call an internal function to do what a documented function claims to do (pass the URL to the system's browser) seems a little roundabout.

I can appreciate the http checks, but still what about ftp? or any other protocol the browser might normally handle...