Web platform features explorer

URL.canParse()

Newly available since 2023-12-07
Tags: api

The URL.canParse() static method checks whether a URL can be parsed into a valid URL object. It's an alternative to calling new URL() in a try … catch statement.

Specifications

Browser support

  • Chrome 120 Released on 2023-12-05
  • Chrome Android 120 Released on 2023-12-05
  • Edge 120 Released on 2023-12-07
  • Firefox 115 Released on 2023-07-04
  • Firefox for Android 115 Released on 2023-07-04
  • Safari 17 Released on 2023-09-18
  • Safari on iOS 17 Released on 2023-09-18

Usage (according to Chrome Platform Status)

~4.612% of page loads. More data at chromestatus.