JS URL object support?

Does Drafts support URL objects? Trying a basic example from that site:

const url = new URL("../cats", "http://www.example.com/dogs");
alert(url.hostname); // "www.example.com"
alert(url.pathname); // "/cats"

Drafts gives the error Can't find variable: URL.

A URL can certainly be built otherwise, but just curious.

No. URL is not part of the core JavaScript language, it’s part of the Web API extensions that browsers add to the language.

Would be pretty easy to recreate with a parsing class, but it’s not part of the language.

1 Like

That makes sense — thank you!