|
|
|
|
|
by jfhr
957 days ago
|
|
Unless you need to support ancient browsers [1], I'd go the easy way and leave the URL parsing to the browser, e.g. `['http:', 'https:', 'mailto:', 'tel:'].includes(new URL(value, location.origin).protocol)` [1] https://caniuse.com/url |
|