happy-dom icon indicating copy to clipboard operation
happy-dom copied to clipboard

URL Parse Error

Open Mas0nShi opened this issue 2 years ago • 2 comments

test code

window.location.href = "//www.google.com";

Return

Location {
  protocol: '',
  hostname: '',
  port: '',
  pathname: '//www.google.com',
  search: '',
  hash: '',
  username: '',
  password: ''
}

Mas0nShi avatar Mar 12 '22 15:03 Mas0nShi

reference link: https://github.com/jsdom/whatwg-url https://url.spec.whatwg.org/#concept-url-parser

It's hard...

Mas0nShi avatar Mar 13 '22 05:03 Mas0nShi

known issues:

  1. serialize URL not impl example code:
const html = `<html>
	<img alt="" name="image" src="//www.google.com"/>
</html>`;
document.write(html);
console.log(document.getElementsByName('image')[0].src);
// "//www.google.com"

Mas0nShi avatar Mar 16 '22 05:03 Mas0nShi