elm / browser

Create Elm programs that run in browsers!
https://package.elm-lang.org/packages/elm/browser/latest/
BSD 3-Clause "New" or "Revised" License
312 stars 64 forks source link

Browser.application programs cannot handle URLs with uncommon protocols like dat:// #20

Open Gozala opened 6 years ago

Gozala commented 6 years ago

I wanted to use Elm to write an app for Beaker - p2p browser which that adds dat protocol support and p2p apps are loaded from URLs like

dat://id.hashbase.io/elm

Unfortunately it seems to break some assumptions made by Browser.application here the error reported in the console:

elm:733 Uncaught Error: Browser.application programs cannot handle URLs like this:

    dat://id.hashbase.io/elm

What is the root? The root of your file system? Try looking at this program with `elm reactor` or some other server.
    at _Debug_crash (elm:733)
    at _Browser_getUrl (elm:4024)
    at init (elm:4014)
    at _Platform_initialize (elm:1871)
    at elm:3909
    at Object.init (elm:30)
    at elm:5254
_Debug_crash @ elm:733
_Browser_getUrl @ elm:4024
init @ elm:4014
_Platform_initialize @ elm:1871
(anonymous) @ elm:3909
(anonymous) @ elm:30
(anonymous) @ elm:5254
Gozala commented 6 years ago

Looking at the source it seems that issue comes from https://github.com/elm/url/ instead.