const url = new URL("blob:https://mozilla.org:443/");
console.log(url.origin); // 'https://mozilla.org'URL: origin property / notebook
URL: origin property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const url = new URL("http://localhost:80/");
console.log(url.origin); // 'http://localhost'const url = new URL("https://mozilla.org:8080/");
console.log(url.origin); // 'https://mozilla.org:8080'