Mas0nShi

Results 17 issues of Mas0nShi

## Tasks - [x] #401 - [x] #452 - [x] #508 - [x] #514 - [x] #521 - [x] #522 - [x] #526 - [ ] #463 - **URL &...

since https://github.com/capricorn86/happy-dom/commit/ec5a307200b36d7518f3236b85b06f5a6c7ef323

Associate with #508 I think this test unit is wrong, so the implementation is wrong too. https://github.com/capricorn86/happy-dom/blob/f9d55eb1f31ee6538935d27c5173be5db11516f8/packages/happy-dom/test/location/RelativeURL.test.ts why? in order to load the web assets in `ResourceFetchHandler.fetchSync` correctly, we used...

bug

similar with #401 load page from web `https://www.geetest.com/demo/test.html` https://github.com/capricorn86/happy-dom/blob/f9d55eb1f31ee6538935d27c5173be5db11516f8/packages/happy-dom/src/nodes/html-script-element/ScriptUtility.ts#L19 the src: `//apps.bdimg.com/libs/jquery/1.9.1/jquery.js` then fetch is used directly, we need parse url first!

bug

e.g. ```javascript const { Window } = require("../packages/happy-dom"); const window = new Window(), document = window.document; document.write(` `); console.log(window.location); ``` this will result in incorrect loading scripts `window.location = 'browser.htm';`

bug
high priority

Link #401 e.g. ```javascript const url = 'http://127.0.0.1:61285/TestPath/test-page'; const u = new window.URL(url); console.log(u); ```

bug

See: https://dom.spec.whatwg.org/#dom-document-url https://developer.mozilla.org/zh-CN/docs/Web/API/Document/URL

enhancement

some websites have enabled anti-theft links, we need to add headers to solve the problem. https://github.com/capricorn86/happy-dom/blob/f4320c383fefce587effbf856ef7ba9954533cba/packages/happy-dom/src/fetch/ResourceFetchHandler.ts#L33-L46 ```javascript /** * Returns resource data synchonously. * * @param document Document. * @param...

enhancement

```javascript const { GlobalRegistrator } = require("../packages/global-registrator"); GlobalRegistrator.register(); window.location.href = "https://www.google.com"; document.write(`window.location.href = "https://www.google.com"; `); console.log(document.getElementsByTagName("html")[0].getInnerHTML()); // window.location.href = "https://www.google.com"; ```

enhancement
question

node add the experimental fetch after v17.5.0, so maybe we can delete package dependency of `node-fetch` in the near future. Refer: https://nodejs.org/en/blog/release/v17.5.0

enhancement