URLPattern is a new web API that provides native support for matching URLs given a pattern string. It is designed to be usable both in javascript directly and by passing patterns to other web platform APIs; e.g. as a service worker scope.
Both web platform features and javascript applications often need to match against URLs. For example, service worker scopes on the web platform side and URL routing in a javascript framework. Past web platform features have individually created their own URL matching mechanism. Javascript has relied on libraries such as path-to-regexp. This effort introduces a common URL matching primitive that can be used in both web platform APIs and directly in javascript.