Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.changeURL = function (window, urlString) {
const doc = idlUtils.implForWrapper(window._document);
const url = whatwgURL.parseURL(urlString);
if (url === "failure") {
throw new TypeError(`Could not parse "${urlString}" as a URL`);
}
doc._URL = url;
doc._origin = whatwgURL.serializeURLToUnicodeOrigin(doc._URL);
};