deprecate / metal-uri

Class for parsing and formatting URIs.
Other
3 stars 7 forks source link

JS error will occur when using the URI constructor with a protocol handler like tel or mailto #5

Closed kienD closed 6 years ago

kienD commented 7 years ago

The maybeAddProtocolAndHostname_(opt_uri) method prepends the uri with http:// and then passes the value to the parse method which is trying to create a new URL(opt_uri) with the original protocol and the http//: protocol prepending it.

For example, if href="tel:123-123-1234" it will try to create a new URL(opt_uri) where opt_uri = "http://tel:123-123-1234".

This will cause the following JS error to occur: Uncaught TypeError: Failed to construct 'URL': Invalid URL

As of now, I know that this is an issue for the following protocol handlers:

I ran into this issue while trying to utilize an anchor to navigate to an application via sennaJS.

eduardolundgren commented 7 years ago

Make sense. Needs to add support for them. Could you please try to make the change? You can coordinate with @fernandosouza if you need help. Thanks.

kienD commented 7 years ago

Sure, I'll make the changes and send a pr.

jbalsas commented 6 years ago

Merged to develop and scheduled for 3.1.0 since we decided to add as an optional new feature rather than fix as a bug.