I have found a solution that is at least acceptable.
For the iOS app I need a postprocessing step in the build tool. In this step I now simply replace “http://” with “file://” in Url.toString
and Url.fromString
. This runs on the optimized and minified elm.js file. That way I only lose the ability to link directly on http://
resources which is acceptable in my case.
As long as anyone on the team uses elm/url
to create href attributes it should work as expected.
If anyone thinks about adopting this approach: this only works because the string "http://"
is only present twice in the compiled app - in exactly those two functions. You also need to make sure to chose a replacement string that is exactly as long as the original, e. g. file://
, abcd://
, or whatever. Otherwise you would also have to adjust the length that is trimmed from the url.