Parsing data-uri with new URL is throwing error in workers

I am trying to parse data-uri using new URL() but its throwing a error TypeError: Invalid URL string.
Below is my code and you can also visit this playground link to view it.

addEventListener("fetch", event => {


async function handleRequest(request) {
  try {
    const parsedDataURI = new URL(dataURI);
    return new Response(`Protocol: ${parsedDataURI.protocol}`)
  } catch(error) {
    return new Response(`${error.toString()}\n\nURL: ${dataURI}`)

I was surprised by this when I hit this in one of our production workers because in browser console it works(see below screenshot)

Is data-uri parsing disabled for some reason or is it a bug in workers?

I believe the URL implementation in the workers runtime is currently limited to http and https. [1]

The URL API supports urls conforming to http and https schemes.


Oh okay. Thanks for the docs link.