happy-dom 13.6.2 → 13.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of happy-dom might be problematic. Click here for more details.

Files changed (339) hide show
  1. package/cjs/browser/BrowserFrame.cjs +12 -2
  2. package/cjs/browser/BrowserFrame.cjs.map +1 -1
  3. package/cjs/browser/BrowserFrame.d.ts.map +1 -1
  4. package/cjs/browser/detached-browser/DetachedBrowserFrame.cjs +12 -2
  5. package/cjs/browser/detached-browser/DetachedBrowserFrame.cjs.map +1 -1
  6. package/cjs/browser/detached-browser/DetachedBrowserFrame.d.ts.map +1 -1
  7. package/cjs/browser/utilities/BrowserFrameFactory.cjs +5 -0
  8. package/cjs/browser/utilities/BrowserFrameFactory.cjs.map +1 -1
  9. package/cjs/browser/utilities/BrowserFrameFactory.d.ts.map +1 -1
  10. package/cjs/browser/utilities/BrowserFrameNavigator.cjs +20 -13
  11. package/cjs/browser/utilities/BrowserFrameNavigator.cjs.map +1 -1
  12. package/cjs/browser/utilities/BrowserFrameNavigator.d.ts +21 -10
  13. package/cjs/browser/utilities/BrowserFrameNavigator.d.ts.map +1 -1
  14. package/cjs/browser/utilities/BrowserFrameURL.cjs +2 -2
  15. package/cjs/browser/utilities/BrowserFrameURL.cjs.map +1 -1
  16. package/cjs/browser/utilities/BrowserFrameURL.d.ts.map +1 -1
  17. package/cjs/config/IHTMLElementTagNameMap.cjs +3 -0
  18. package/cjs/config/IHTMLElementTagNameMap.cjs.map +1 -0
  19. package/cjs/config/IHTMLElementTagNameMap.d.ts +146 -0
  20. package/cjs/config/IHTMLElementTagNameMap.d.ts.map +1 -0
  21. package/cjs/config/ISVGElementTagNameMap.cjs +3 -0
  22. package/cjs/config/ISVGElementTagNameMap.cjs.map +1 -0
  23. package/cjs/config/ISVGElementTagNameMap.d.ts +67 -0
  24. package/cjs/config/ISVGElementTagNameMap.d.ts.map +1 -0
  25. package/cjs/event/events/HashChangeEvent.cjs +26 -0
  26. package/cjs/event/events/HashChangeEvent.cjs.map +1 -0
  27. package/cjs/event/events/HashChangeEvent.d.ts +19 -0
  28. package/cjs/event/events/HashChangeEvent.d.ts.map +1 -0
  29. package/cjs/event/events/IHashChangeEventInit.cjs +3 -0
  30. package/cjs/event/events/IHashChangeEventInit.cjs.map +1 -0
  31. package/cjs/event/events/IHashChangeEventInit.d.ts +6 -0
  32. package/cjs/event/events/IHashChangeEventInit.d.ts.map +1 -0
  33. package/cjs/fetch/Fetch.cjs +3 -3
  34. package/cjs/fetch/Fetch.cjs.map +1 -1
  35. package/cjs/fetch/Request.cjs +2 -2
  36. package/cjs/fetch/Request.cjs.map +1 -1
  37. package/cjs/fetch/SyncFetch.cjs +3 -3
  38. package/cjs/fetch/SyncFetch.cjs.map +1 -1
  39. package/cjs/fetch/utilities/FetchRequestHeaderUtility.cjs +5 -3
  40. package/cjs/fetch/utilities/FetchRequestHeaderUtility.cjs.map +1 -1
  41. package/cjs/fetch/utilities/FetchRequestHeaderUtility.d.ts.map +1 -1
  42. package/cjs/fetch/utilities/FetchRequestReferrerUtility.cjs +1 -1
  43. package/cjs/fetch/utilities/FetchRequestReferrerUtility.cjs.map +1 -1
  44. package/cjs/fetch/utilities/FetchRequestReferrerUtility.d.ts.map +1 -1
  45. package/cjs/form-data/FormData.cjs +1 -1
  46. package/cjs/form-data/FormData.cjs.map +1 -1
  47. package/cjs/form-data/FormData.d.ts +1 -1
  48. package/cjs/form-data/FormData.d.ts.map +1 -1
  49. package/cjs/index.cjs +7 -3
  50. package/cjs/index.cjs.map +1 -1
  51. package/cjs/index.d.ts +7 -3
  52. package/cjs/index.d.ts.map +1 -1
  53. package/cjs/location/Location.cjs +270 -0
  54. package/cjs/location/Location.cjs.map +1 -0
  55. package/cjs/location/Location.d.ts +144 -0
  56. package/cjs/location/Location.d.ts.map +1 -0
  57. package/cjs/named-node-map/NamedNodeMap.cjs +2 -1
  58. package/cjs/named-node-map/NamedNodeMap.cjs.map +1 -1
  59. package/cjs/named-node-map/NamedNodeMap.d.ts.map +1 -1
  60. package/cjs/nodes/document/Document.cjs +4 -4
  61. package/cjs/nodes/document/Document.cjs.map +1 -1
  62. package/cjs/nodes/document/Document.d.ts +114 -6
  63. package/cjs/nodes/document/Document.d.ts.map +1 -1
  64. package/cjs/nodes/document/IDocument.d.ts +28 -12
  65. package/cjs/nodes/document/IDocument.d.ts.map +1 -1
  66. package/cjs/nodes/document-fragment/DocumentFragment.cjs +2 -2
  67. package/cjs/nodes/document-fragment/DocumentFragment.cjs.map +1 -1
  68. package/cjs/nodes/document-fragment/DocumentFragment.d.ts +31 -1
  69. package/cjs/nodes/document-fragment/DocumentFragment.d.ts.map +1 -1
  70. package/cjs/nodes/document-fragment/IDocumentFragment.d.ts +6 -0
  71. package/cjs/nodes/document-fragment/IDocumentFragment.d.ts.map +1 -1
  72. package/cjs/nodes/element/Element.cjs +1 -1
  73. package/cjs/nodes/element/Element.cjs.map +1 -1
  74. package/cjs/nodes/element/Element.d.ts +61 -1
  75. package/cjs/nodes/element/Element.d.ts.map +1 -1
  76. package/cjs/nodes/element/HTMLCollection.cjs +2 -1
  77. package/cjs/nodes/element/HTMLCollection.cjs.map +1 -1
  78. package/cjs/nodes/element/HTMLCollection.d.ts.map +1 -1
  79. package/cjs/nodes/html-anchor-element/HTMLAnchorElement.cjs +2 -0
  80. package/cjs/nodes/html-anchor-element/HTMLAnchorElement.cjs.map +1 -1
  81. package/cjs/nodes/html-anchor-element/HTMLAnchorElement.d.ts.map +1 -1
  82. package/cjs/nodes/html-button-element/HTMLButtonElement.cjs +93 -4
  83. package/cjs/nodes/html-button-element/HTMLButtonElement.cjs.map +1 -1
  84. package/cjs/nodes/html-button-element/HTMLButtonElement.d.ts +49 -1
  85. package/cjs/nodes/html-button-element/HTMLButtonElement.d.ts.map +1 -1
  86. package/cjs/nodes/html-button-element/IHTMLButtonElement.d.ts +5 -1
  87. package/cjs/nodes/html-button-element/IHTMLButtonElement.d.ts.map +1 -1
  88. package/cjs/nodes/html-form-element/HTMLFormControlsCollection.cjs +2 -1
  89. package/cjs/nodes/html-form-element/HTMLFormControlsCollection.cjs.map +1 -1
  90. package/cjs/nodes/html-form-element/HTMLFormControlsCollection.d.ts.map +1 -1
  91. package/cjs/nodes/html-form-element/HTMLFormElement.cjs +104 -9
  92. package/cjs/nodes/html-form-element/HTMLFormElement.cjs.map +1 -1
  93. package/cjs/nodes/html-form-element/HTMLFormElement.d.ts +8 -2
  94. package/cjs/nodes/html-form-element/HTMLFormElement.d.ts.map +1 -1
  95. package/cjs/nodes/html-iframe-element/HTMLIFrameElement.cjs +14 -0
  96. package/cjs/nodes/html-iframe-element/HTMLIFrameElement.cjs.map +1 -1
  97. package/cjs/nodes/html-iframe-element/HTMLIFrameElement.d.ts +10 -0
  98. package/cjs/nodes/html-iframe-element/HTMLIFrameElement.d.ts.map +1 -1
  99. package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.cjs +4 -1
  100. package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.cjs.map +1 -1
  101. package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.d.ts.map +1 -1
  102. package/cjs/nodes/html-iframe-element/IHTMLIFrameElement.d.ts +1 -0
  103. package/cjs/nodes/html-iframe-element/IHTMLIFrameElement.d.ts.map +1 -1
  104. package/cjs/nodes/html-input-element/HTMLInputElement.cjs +100 -52
  105. package/cjs/nodes/html-input-element/HTMLInputElement.cjs.map +1 -1
  106. package/cjs/nodes/html-input-element/HTMLInputElement.d.ts +49 -23
  107. package/cjs/nodes/html-input-element/HTMLInputElement.d.ts.map +1 -1
  108. package/cjs/nodes/html-input-element/IHTMLInputElement.d.ts +2 -0
  109. package/cjs/nodes/html-input-element/IHTMLInputElement.d.ts.map +1 -1
  110. package/cjs/nodes/html-label-element/HTMLLabelElement.cjs +1 -0
  111. package/cjs/nodes/html-label-element/HTMLLabelElement.cjs.map +1 -1
  112. package/cjs/nodes/html-label-element/HTMLLabelElement.d.ts.map +1 -1
  113. package/cjs/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.cjs +1 -1
  114. package/cjs/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.cjs.map +1 -1
  115. package/cjs/nodes/html-script-element/HTMLScriptElementScriptLoader.cjs +1 -1
  116. package/cjs/nodes/html-script-element/HTMLScriptElementScriptLoader.cjs.map +1 -1
  117. package/cjs/nodes/html-select-element/HTMLSelectElement.cjs.map +1 -1
  118. package/cjs/nodes/html-select-element/HTMLSelectElement.d.ts.map +1 -1
  119. package/cjs/nodes/node/Node.cjs.map +1 -1
  120. package/cjs/nodes/node/Node.d.ts.map +1 -1
  121. package/cjs/nodes/parent-node/IParentNode.d.ts +17 -0
  122. package/cjs/nodes/parent-node/IParentNode.d.ts.map +1 -1
  123. package/cjs/nodes/parent-node/ParentNodeUtility.cjs.map +1 -1
  124. package/cjs/nodes/parent-node/ParentNodeUtility.d.ts.map +1 -1
  125. package/cjs/query-selector/QuerySelector.cjs.map +1 -1
  126. package/cjs/query-selector/QuerySelector.d.ts +34 -0
  127. package/cjs/query-selector/QuerySelector.d.ts.map +1 -1
  128. package/cjs/version.cjs +1 -1
  129. package/cjs/window/BrowserWindow.cjs +9 -3
  130. package/cjs/window/BrowserWindow.cjs.map +1 -1
  131. package/cjs/window/BrowserWindow.d.ts +5 -4
  132. package/cjs/window/BrowserWindow.d.ts.map +1 -1
  133. package/cjs/window/CrossOriginBrowserWindow.d.ts +1 -1
  134. package/cjs/window/CrossOriginBrowserWindow.d.ts.map +1 -1
  135. package/cjs/window/IBrowserWindow.d.ts +3 -2
  136. package/cjs/window/IBrowserWindow.d.ts.map +1 -1
  137. package/cjs/window/ICrossOriginBrowserWindow.d.ts +1 -1
  138. package/cjs/window/ICrossOriginBrowserWindow.d.ts.map +1 -1
  139. package/cjs/window/WindowPageOpenUtility.cjs +4 -2
  140. package/cjs/window/WindowPageOpenUtility.cjs.map +1 -1
  141. package/cjs/window/WindowPageOpenUtility.d.ts.map +1 -1
  142. package/lib/browser/BrowserFrame.d.ts.map +1 -1
  143. package/lib/browser/BrowserFrame.js +12 -2
  144. package/lib/browser/BrowserFrame.js.map +1 -1
  145. package/lib/browser/detached-browser/DetachedBrowserFrame.d.ts.map +1 -1
  146. package/lib/browser/detached-browser/DetachedBrowserFrame.js +12 -2
  147. package/lib/browser/detached-browser/DetachedBrowserFrame.js.map +1 -1
  148. package/lib/browser/utilities/BrowserFrameFactory.d.ts.map +1 -1
  149. package/lib/browser/utilities/BrowserFrameFactory.js +5 -0
  150. package/lib/browser/utilities/BrowserFrameFactory.js.map +1 -1
  151. package/lib/browser/utilities/BrowserFrameNavigator.d.ts +21 -10
  152. package/lib/browser/utilities/BrowserFrameNavigator.d.ts.map +1 -1
  153. package/lib/browser/utilities/BrowserFrameNavigator.js +20 -13
  154. package/lib/browser/utilities/BrowserFrameNavigator.js.map +1 -1
  155. package/lib/browser/utilities/BrowserFrameURL.d.ts.map +1 -1
  156. package/lib/browser/utilities/BrowserFrameURL.js +2 -2
  157. package/lib/browser/utilities/BrowserFrameURL.js.map +1 -1
  158. package/lib/config/IHTMLElementTagNameMap.d.ts +146 -0
  159. package/lib/config/IHTMLElementTagNameMap.d.ts.map +1 -0
  160. package/lib/config/IHTMLElementTagNameMap.js +2 -0
  161. package/lib/config/IHTMLElementTagNameMap.js.map +1 -0
  162. package/lib/config/ISVGElementTagNameMap.d.ts +67 -0
  163. package/lib/config/ISVGElementTagNameMap.d.ts.map +1 -0
  164. package/lib/config/ISVGElementTagNameMap.js +2 -0
  165. package/lib/config/ISVGElementTagNameMap.js.map +1 -0
  166. package/lib/event/events/HashChangeEvent.d.ts +19 -0
  167. package/lib/event/events/HashChangeEvent.d.ts.map +1 -0
  168. package/lib/event/events/HashChangeEvent.js +20 -0
  169. package/lib/event/events/HashChangeEvent.js.map +1 -0
  170. package/lib/event/events/IHashChangeEventInit.d.ts +6 -0
  171. package/lib/event/events/IHashChangeEventInit.d.ts.map +1 -0
  172. package/lib/event/events/IHashChangeEventInit.js +2 -0
  173. package/lib/event/events/IHashChangeEventInit.js.map +1 -0
  174. package/lib/fetch/Fetch.js +3 -3
  175. package/lib/fetch/Fetch.js.map +1 -1
  176. package/lib/fetch/Request.js +2 -2
  177. package/lib/fetch/Request.js.map +1 -1
  178. package/lib/fetch/SyncFetch.js +3 -3
  179. package/lib/fetch/SyncFetch.js.map +1 -1
  180. package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts.map +1 -1
  181. package/lib/fetch/utilities/FetchRequestHeaderUtility.js +4 -2
  182. package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -1
  183. package/lib/fetch/utilities/FetchRequestReferrerUtility.d.ts.map +1 -1
  184. package/lib/fetch/utilities/FetchRequestReferrerUtility.js +1 -1
  185. package/lib/fetch/utilities/FetchRequestReferrerUtility.js.map +1 -1
  186. package/lib/form-data/FormData.d.ts +1 -1
  187. package/lib/form-data/FormData.d.ts.map +1 -1
  188. package/lib/form-data/FormData.js +1 -1
  189. package/lib/form-data/FormData.js.map +1 -1
  190. package/lib/index.d.ts +7 -3
  191. package/lib/index.d.ts.map +1 -1
  192. package/lib/index.js +4 -2
  193. package/lib/index.js.map +1 -1
  194. package/lib/location/Location.d.ts +144 -0
  195. package/lib/location/Location.d.ts.map +1 -0
  196. package/lib/location/Location.js +241 -0
  197. package/lib/location/Location.js.map +1 -0
  198. package/lib/named-node-map/NamedNodeMap.d.ts.map +1 -1
  199. package/lib/named-node-map/NamedNodeMap.js +2 -1
  200. package/lib/named-node-map/NamedNodeMap.js.map +1 -1
  201. package/lib/nodes/document/Document.d.ts +114 -6
  202. package/lib/nodes/document/Document.d.ts.map +1 -1
  203. package/lib/nodes/document/Document.js +4 -4
  204. package/lib/nodes/document/Document.js.map +1 -1
  205. package/lib/nodes/document/IDocument.d.ts +28 -12
  206. package/lib/nodes/document/IDocument.d.ts.map +1 -1
  207. package/lib/nodes/document-fragment/DocumentFragment.d.ts +31 -1
  208. package/lib/nodes/document-fragment/DocumentFragment.d.ts.map +1 -1
  209. package/lib/nodes/document-fragment/DocumentFragment.js +2 -2
  210. package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
  211. package/lib/nodes/document-fragment/IDocumentFragment.d.ts +6 -0
  212. package/lib/nodes/document-fragment/IDocumentFragment.d.ts.map +1 -1
  213. package/lib/nodes/element/Element.d.ts +61 -1
  214. package/lib/nodes/element/Element.d.ts.map +1 -1
  215. package/lib/nodes/element/Element.js +1 -1
  216. package/lib/nodes/element/Element.js.map +1 -1
  217. package/lib/nodes/element/HTMLCollection.d.ts.map +1 -1
  218. package/lib/nodes/element/HTMLCollection.js +2 -1
  219. package/lib/nodes/element/HTMLCollection.js.map +1 -1
  220. package/lib/nodes/html-anchor-element/HTMLAnchorElement.d.ts.map +1 -1
  221. package/lib/nodes/html-anchor-element/HTMLAnchorElement.js +2 -0
  222. package/lib/nodes/html-anchor-element/HTMLAnchorElement.js.map +1 -1
  223. package/lib/nodes/html-button-element/HTMLButtonElement.d.ts +49 -1
  224. package/lib/nodes/html-button-element/HTMLButtonElement.d.ts.map +1 -1
  225. package/lib/nodes/html-button-element/HTMLButtonElement.js +93 -4
  226. package/lib/nodes/html-button-element/HTMLButtonElement.js.map +1 -1
  227. package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts +5 -1
  228. package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts.map +1 -1
  229. package/lib/nodes/html-form-element/HTMLFormControlsCollection.d.ts.map +1 -1
  230. package/lib/nodes/html-form-element/HTMLFormControlsCollection.js +2 -1
  231. package/lib/nodes/html-form-element/HTMLFormControlsCollection.js.map +1 -1
  232. package/lib/nodes/html-form-element/HTMLFormElement.d.ts +8 -2
  233. package/lib/nodes/html-form-element/HTMLFormElement.d.ts.map +1 -1
  234. package/lib/nodes/html-form-element/HTMLFormElement.js +106 -10
  235. package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
  236. package/lib/nodes/html-iframe-element/HTMLIFrameElement.d.ts +10 -0
  237. package/lib/nodes/html-iframe-element/HTMLIFrameElement.d.ts.map +1 -1
  238. package/lib/nodes/html-iframe-element/HTMLIFrameElement.js +14 -0
  239. package/lib/nodes/html-iframe-element/HTMLIFrameElement.js.map +1 -1
  240. package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.d.ts.map +1 -1
  241. package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.js +4 -1
  242. package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.js.map +1 -1
  243. package/lib/nodes/html-iframe-element/IHTMLIFrameElement.d.ts +1 -0
  244. package/lib/nodes/html-iframe-element/IHTMLIFrameElement.d.ts.map +1 -1
  245. package/lib/nodes/html-input-element/HTMLInputElement.d.ts +49 -23
  246. package/lib/nodes/html-input-element/HTMLInputElement.d.ts.map +1 -1
  247. package/lib/nodes/html-input-element/HTMLInputElement.js +100 -52
  248. package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
  249. package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +2 -0
  250. package/lib/nodes/html-input-element/IHTMLInputElement.d.ts.map +1 -1
  251. package/lib/nodes/html-label-element/HTMLLabelElement.d.ts.map +1 -1
  252. package/lib/nodes/html-label-element/HTMLLabelElement.js +1 -0
  253. package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
  254. package/lib/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.js +1 -1
  255. package/lib/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.js.map +1 -1
  256. package/lib/nodes/html-script-element/HTMLScriptElementScriptLoader.js +1 -1
  257. package/lib/nodes/html-script-element/HTMLScriptElementScriptLoader.js.map +1 -1
  258. package/lib/nodes/html-select-element/HTMLSelectElement.d.ts.map +1 -1
  259. package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
  260. package/lib/nodes/node/Node.d.ts.map +1 -1
  261. package/lib/nodes/node/Node.js.map +1 -1
  262. package/lib/nodes/parent-node/IParentNode.d.ts +17 -0
  263. package/lib/nodes/parent-node/IParentNode.d.ts.map +1 -1
  264. package/lib/nodes/parent-node/ParentNodeUtility.d.ts.map +1 -1
  265. package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
  266. package/lib/query-selector/QuerySelector.d.ts +34 -0
  267. package/lib/query-selector/QuerySelector.d.ts.map +1 -1
  268. package/lib/query-selector/QuerySelector.js.map +1 -1
  269. package/lib/version.js +1 -1
  270. package/lib/window/BrowserWindow.d.ts +5 -4
  271. package/lib/window/BrowserWindow.d.ts.map +1 -1
  272. package/lib/window/BrowserWindow.js +10 -4
  273. package/lib/window/BrowserWindow.js.map +1 -1
  274. package/lib/window/CrossOriginBrowserWindow.d.ts +1 -1
  275. package/lib/window/CrossOriginBrowserWindow.d.ts.map +1 -1
  276. package/lib/window/IBrowserWindow.d.ts +3 -2
  277. package/lib/window/IBrowserWindow.d.ts.map +1 -1
  278. package/lib/window/ICrossOriginBrowserWindow.d.ts +1 -1
  279. package/lib/window/ICrossOriginBrowserWindow.d.ts.map +1 -1
  280. package/lib/window/WindowPageOpenUtility.d.ts.map +1 -1
  281. package/lib/window/WindowPageOpenUtility.js +4 -2
  282. package/lib/window/WindowPageOpenUtility.js.map +1 -1
  283. package/package.json +1 -1
  284. package/src/browser/BrowserFrame.ts +12 -2
  285. package/src/browser/detached-browser/DetachedBrowserFrame.ts +12 -7
  286. package/src/browser/utilities/BrowserFrameFactory.ts +7 -0
  287. package/src/browser/utilities/BrowserFrameNavigator.ts +28 -18
  288. package/src/browser/utilities/BrowserFrameURL.ts +2 -2
  289. package/src/config/IHTMLElementTagNameMap.ts +148 -0
  290. package/src/config/ISVGElementTagNameMap.ts +67 -0
  291. package/src/event/events/HashChangeEvent.ts +25 -0
  292. package/src/event/events/IHashChangeEventInit.ts +6 -0
  293. package/src/fetch/Fetch.ts +3 -3
  294. package/src/fetch/Request.ts +2 -2
  295. package/src/fetch/SyncFetch.ts +3 -3
  296. package/src/fetch/utilities/FetchRequestHeaderUtility.ts +4 -5
  297. package/src/fetch/utilities/FetchRequestReferrerUtility.ts +2 -1
  298. package/src/form-data/FormData.ts +2 -2
  299. package/src/index.ts +9 -1
  300. package/src/location/Location.ts +257 -0
  301. package/src/named-node-map/NamedNodeMap.ts +1 -0
  302. package/src/nodes/document/Document.ts +224 -17
  303. package/src/nodes/document/IDocument.ts +33 -11
  304. package/src/nodes/document-fragment/DocumentFragment.ts +59 -1
  305. package/src/nodes/document-fragment/IDocumentFragment.ts +14 -0
  306. package/src/nodes/element/Element.ts +120 -1
  307. package/src/nodes/element/HTMLCollection.ts +1 -0
  308. package/src/nodes/html-anchor-element/HTMLAnchorElement.ts +2 -0
  309. package/src/nodes/html-button-element/HTMLButtonElement.ts +107 -5
  310. package/src/nodes/html-button-element/IHTMLButtonElement.ts +5 -1
  311. package/src/nodes/html-form-element/HTMLFormControlsCollection.ts +1 -0
  312. package/src/nodes/html-form-element/HTMLFormElement.ts +111 -5
  313. package/src/nodes/html-iframe-element/HTMLIFrameElement.ts +16 -0
  314. package/src/nodes/html-iframe-element/HTMLIFrameElementPageLoader.ts +5 -1
  315. package/src/nodes/html-iframe-element/IHTMLIFrameElement.ts +1 -0
  316. package/src/nodes/html-input-element/HTMLInputElement.ts +111 -57
  317. package/src/nodes/html-input-element/IHTMLInputElement.ts +2 -0
  318. package/src/nodes/html-label-element/HTMLLabelElement.ts +1 -0
  319. package/src/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.ts +1 -1
  320. package/src/nodes/html-script-element/HTMLScriptElementScriptLoader.ts +1 -1
  321. package/src/nodes/html-select-element/HTMLSelectElement.ts +1 -2
  322. package/src/nodes/node/Node.ts +1 -2
  323. package/src/nodes/parent-node/IParentNode.ts +36 -0
  324. package/src/nodes/parent-node/ParentNodeUtility.ts +1 -0
  325. package/src/query-selector/QuerySelector.ts +76 -2
  326. package/src/window/BrowserWindow.ts +11 -4
  327. package/src/window/CrossOriginBrowserWindow.ts +1 -1
  328. package/src/window/IBrowserWindow.ts +3 -2
  329. package/src/window/ICrossOriginBrowserWindow.ts +1 -1
  330. package/src/window/WindowPageOpenUtility.ts +4 -2
  331. package/cjs/url/Location.cjs +0 -111
  332. package/cjs/url/Location.cjs.map +0 -1
  333. package/cjs/url/Location.d.ts +0 -48
  334. package/cjs/url/Location.d.ts.map +0 -1
  335. package/lib/url/Location.d.ts +0 -48
  336. package/lib/url/Location.d.ts.map +0 -1
  337. package/lib/url/Location.js +0 -82
  338. package/lib/url/Location.js.map +0 -1
  339. package/src/url/Location.ts +0 -79
@@ -167,7 +167,12 @@ export default class DetachedBrowserFrame implements IBrowserFrame {
167
167
  * @returns Response.
168
168
  */
169
169
  public goto(url: string, options?: IGoToOptions): Promise<IResponse | null> {
170
- return BrowserFrameNavigator.goto(this.page.context.browser.windowClass, this, url, options);
170
+ return BrowserFrameNavigator.navigate({
171
+ windowClass: this.page.context.browser.windowClass,
172
+ frame: this,
173
+ url: url,
174
+ goToOptions: options
175
+ });
171
176
  }
172
177
 
173
178
  /**
@@ -177,11 +182,11 @@ export default class DetachedBrowserFrame implements IBrowserFrame {
177
182
  * @returns Response.
178
183
  */
179
184
  public reload(options: IReloadOptions): Promise<IResponse | null> {
180
- return BrowserFrameNavigator.goto(
181
- this.page.context.browser.windowClass,
182
- this,
183
- this.url,
184
- options
185
- );
185
+ return BrowserFrameNavigator.navigate({
186
+ windowClass: this.page.context.browser.windowClass,
187
+ frame: this,
188
+ url: this.url,
189
+ goToOptions: options
190
+ });
186
191
  }
187
192
  }
@@ -63,11 +63,18 @@ export default class BrowserFrameFactory {
63
63
  return frame[PropertySymbol.asyncTaskManager].destroy().then(() => {
64
64
  frame[PropertySymbol.exceptionObserver]?.disconnect();
65
65
  if (frame.window) {
66
+ const listeners = frame[PropertySymbol.listeners];
67
+
66
68
  frame.window[PropertySymbol.destroy]();
67
69
  (<IBrowserPage | null>frame.page) = null;
68
70
  (<IBrowserWindow | null>frame.window) = null;
71
+ frame[PropertySymbol.listeners] = null;
69
72
  frame[PropertySymbol.openerFrame] = null;
70
73
  frame[PropertySymbol.openerWindow] = null;
74
+
75
+ for (const listener of listeners.navigation) {
76
+ listener();
77
+ }
71
78
  }
72
79
  resolve();
73
80
  });
@@ -11,30 +11,38 @@ import BrowserFrameURL from './BrowserFrameURL.js';
11
11
  import BrowserFrameValidator from './BrowserFrameValidator.js';
12
12
  import AsyncTaskManager from '../../async-task-manager/AsyncTaskManager.js';
13
13
  import BrowserErrorCaptureEnum from '../enums/BrowserErrorCaptureEnum.js';
14
+ import FormData from '../../form-data/FormData.js';
14
15
 
15
16
  /**
16
17
  * Browser frame navigation utility.
17
18
  */
18
19
  export default class BrowserFrameNavigator {
19
20
  /**
20
- * Go to a page.
21
+ * Navigates to a page.
21
22
  *
22
23
  * @throws Error if the request can't be resolved (because of SSL error or similar). It will not throw if the response is not ok.
23
- * @param windowClass Window class.
24
- * @param frame Frame.
25
- * @param url URL.
26
- * @param [options] Options.
24
+ * @param options Options.
25
+ * @param options.windowClass Window class.
26
+ * @param options.frame Frame.
27
+ * @param options.url URL.
28
+ * @param [options.formData] Form data.
29
+ * @param [options.method] Method.
30
+ * @param [options.goToOptions] Go to options.
27
31
  * @returns Response.
28
32
  */
29
- public static async goto(
33
+ public static async navigate(options: {
30
34
  windowClass: new (
31
35
  browserFrame: IBrowserFrame,
32
36
  options?: { url?: string; width?: number; height?: number }
33
- ) => IBrowserWindow,
34
- frame: IBrowserFrame,
35
- url: string,
36
- options?: IGoToOptions
37
- ): Promise<IResponse | null> {
37
+ ) => IBrowserWindow;
38
+ frame: IBrowserFrame;
39
+ url: string;
40
+ goToOptions?: IGoToOptions;
41
+ method?: string;
42
+ formData?: FormData;
43
+ }): Promise<IResponse | null> {
44
+ const { windowClass, frame, url, formData, method, goToOptions } = options;
45
+ const referrer = goToOptions?.referrer || frame.window.location.origin;
38
46
  const targetURL = BrowserFrameURL.getRelativeURL(frame, url);
39
47
 
40
48
  if (!frame.window) {
@@ -98,8 +106,8 @@ export default class BrowserFrameNavigator {
98
106
  (<IBrowserWindow>frame.window) = new windowClass(frame, { url: targetURL.href, width, height });
99
107
  (<number>frame.window.devicePixelRatio) = devicePixelRatio;
100
108
 
101
- if (options?.referrer) {
102
- frame.window.document[PropertySymbol.referrer] = options.referrer;
109
+ if (referrer) {
110
+ frame.window.document[PropertySymbol.referrer] = referrer;
103
111
  }
104
112
 
105
113
  if (targetURL.protocol === 'about:') {
@@ -118,7 +126,7 @@ export default class BrowserFrameNavigator {
118
126
 
119
127
  const timeout = frame.window.setTimeout(
120
128
  () => abortController.abort('Request timed out.'),
121
- options?.timeout ?? 30000
129
+ goToOptions?.timeout ?? 30000
122
130
  );
123
131
  const finalize = (): void => {
124
132
  frame.window.clearTimeout(timeout);
@@ -132,16 +140,18 @@ export default class BrowserFrameNavigator {
132
140
 
133
141
  try {
134
142
  response = await frame.window.fetch(targetURL.href, {
135
- referrer: options?.referrer,
136
- referrerPolicy: options?.referrerPolicy,
143
+ referrer,
144
+ referrerPolicy: goToOptions?.referrerPolicy || 'origin',
137
145
  signal: abortController.signal,
138
- headers: options?.hard ? { 'Cache-Control': 'no-cache' } : undefined
146
+ method: method || (formData ? 'POST' : 'GET'),
147
+ headers: goToOptions?.hard ? { 'Cache-Control': 'no-cache' } : undefined,
148
+ body: formData
139
149
  });
140
150
 
141
151
  // Handles the "X-Frame-Options" header for child frames.
142
152
  if (frame.parentFrame) {
143
153
  const originURL = frame.parentFrame.window.location;
144
- const xFrameOptions = response.headers.get('X-Frame-Options')?.toLowerCase();
154
+ const xFrameOptions = response.headers?.get('X-Frame-Options')?.toLowerCase();
145
155
  const isSameOrigin = originURL.origin === targetURL.origin || targetURL.origin === 'null';
146
156
 
147
157
  if (xFrameOptions === 'deny' || (xFrameOptions === 'sameorigin' && !isSameOrigin)) {
@@ -1,7 +1,7 @@
1
1
  import IBrowserFrame from '../types/IBrowserFrame.js';
2
- import { URL } from 'url';
3
2
  import DOMException from '../../exception/DOMException.js';
4
3
  import DOMExceptionNameEnum from '../../exception/DOMExceptionNameEnum.js';
4
+ import { URL } from 'url';
5
5
 
6
6
  /**
7
7
  * Browser frame URL utility.
@@ -22,7 +22,7 @@ export default class BrowserFrameURL {
22
22
  }
23
23
 
24
24
  try {
25
- return new URL(url, frame.window.location);
25
+ return new URL(url, frame.window.location.href);
26
26
  } catch (e) {
27
27
  if (frame.window.location.hostname) {
28
28
  throw new DOMException(
@@ -0,0 +1,148 @@
1
+ import IHTMLAnchorElement from '../nodes/html-anchor-element/IHTMLAnchorElement.js';
2
+ import IHTMLElement from '../nodes/html-element/IHTMLElement.js';
3
+ import IHTMLAudioElement from '../nodes/html-audio-element/IHTMLAudioElement.js';
4
+ import IHTMLBaseElement from '../nodes/html-base-element/IHTMLBaseElement.js';
5
+ import IHTMLTemplateElement from '../nodes/html-template-element/IHTMLTemplateElement.js';
6
+ import IHTMLFormElement from '../nodes/html-form-element/IHTMLFormElement.js';
7
+ import IHTMLInputElement from '../nodes/html-input-element/IHTMLInputElement.js';
8
+ import IHTMLTextAreaElement from '../nodes/html-text-area-element/IHTMLTextAreaElement.js';
9
+ import IHTMLScriptElement from '../nodes/html-script-element/IHTMLScriptElement.js';
10
+ import IHTMLImageElement from '../nodes/html-image-element/IHTMLImageElement.js';
11
+ import IHTMLLinkElement from '../nodes/html-link-element/IHTMLLinkElement.js';
12
+ import IHTMLStyleElement from '../nodes/html-style-element/IHTMLStyleElement.js';
13
+ import IHTMLLabelElement from '../nodes/html-label-element/IHTMLLabelElement.js';
14
+ import IHTMLSlotElement from '../nodes/html-slot-element/IHTMLSlotElement.js';
15
+ import IHTMLMetaElement from '../nodes/html-meta-element/IHTMLMetaElement.js';
16
+ import IHTMLButtonElement from '../nodes/html-button-element/IHTMLButtonElement.js';
17
+ import IHTMLDialogElement from '../nodes/html-dialog-element/IHTMLDialogElement.js';
18
+ import IHTMLIFrameElement from '../nodes/html-iframe-element/IHTMLIFrameElement.js';
19
+ import IHTMLOptGroupElement from '../nodes/html-opt-group-element/IHTMLOptGroupElement.js';
20
+ import IHTMLOptionElement from '../nodes/html-option-element/IHTMLOptionElement.js';
21
+ import IHTMLSelectElement from '../nodes/html-select-element/IHTMLSelectElement.js';
22
+ import IHTMLVideoElement from '../nodes/html-video-element/IHTMLVideoElement.js';
23
+
24
+ // Makes it work with custom elements when they declare their own interface.
25
+ declare global {
26
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
27
+ interface HTMLElementTagNameMap {}
28
+ }
29
+
30
+ export default interface IHTMLElementTagNameMap extends HTMLElementTagNameMap {
31
+ a: IHTMLAnchorElement;
32
+ abbr: IHTMLElement;
33
+ address: IHTMLElement;
34
+ area: IHTMLElement;
35
+ article: IHTMLElement;
36
+ aside: IHTMLElement;
37
+ audio: IHTMLAudioElement;
38
+ b: IHTMLElement;
39
+ base: IHTMLBaseElement;
40
+ bdi: IHTMLElement;
41
+ bdo: IHTMLElement;
42
+ blockquaote: IHTMLElement;
43
+ body: IHTMLElement;
44
+ template: IHTMLTemplateElement;
45
+ form: IHTMLFormElement;
46
+ input: IHTMLInputElement;
47
+ textarea: IHTMLTextAreaElement;
48
+ script: IHTMLScriptElement;
49
+ img: IHTMLImageElement;
50
+ link: IHTMLLinkElement;
51
+ style: IHTMLStyleElement;
52
+ label: IHTMLLabelElement;
53
+ slot: IHTMLSlotElement;
54
+ meta: IHTMLMetaElement;
55
+ blockquote: IHTMLElement;
56
+ br: IHTMLElement;
57
+ button: IHTMLButtonElement;
58
+ canvas: IHTMLElement;
59
+ caption: IHTMLElement;
60
+ cite: IHTMLElement;
61
+ code: IHTMLElement;
62
+ col: IHTMLElement;
63
+ colgroup: IHTMLElement;
64
+ data: IHTMLElement;
65
+ datalist: IHTMLElement;
66
+ dd: IHTMLElement;
67
+ del: IHTMLElement;
68
+ details: IHTMLElement;
69
+ dfn: IHTMLElement;
70
+ dialog: IHTMLDialogElement;
71
+ div: IHTMLElement;
72
+ dl: IHTMLElement;
73
+ dt: IHTMLElement;
74
+ em: IHTMLElement;
75
+ embed: IHTMLElement;
76
+ fieldset: IHTMLElement;
77
+ figcaption: IHTMLElement;
78
+ figure: IHTMLElement;
79
+ footer: IHTMLElement;
80
+ h1: IHTMLElement;
81
+ h2: IHTMLElement;
82
+ h3: IHTMLElement;
83
+ h4: IHTMLElement;
84
+ h5: IHTMLElement;
85
+ h6: IHTMLElement;
86
+ head: IHTMLElement;
87
+ header: IHTMLElement;
88
+ hgroup: IHTMLElement;
89
+ hr: IHTMLElement;
90
+ html: IHTMLElement;
91
+ i: IHTMLElement;
92
+ iframe: IHTMLIFrameElement;
93
+ ins: IHTMLElement;
94
+ kbd: IHTMLElement;
95
+ legend: IHTMLElement;
96
+ li: IHTMLElement;
97
+ main: IHTMLElement;
98
+ map: IHTMLElement;
99
+ mark: IHTMLElement;
100
+ math: IHTMLElement;
101
+ menu: IHTMLElement;
102
+ menuitem: IHTMLElement;
103
+ meter: IHTMLElement;
104
+ nav: IHTMLElement;
105
+ noscript: IHTMLElement;
106
+ object: IHTMLElement;
107
+ ol: IHTMLElement;
108
+ optgroup: IHTMLOptGroupElement;
109
+ option: IHTMLOptionElement;
110
+ output: IHTMLElement;
111
+ p: IHTMLElement;
112
+ param: IHTMLElement;
113
+ picture: IHTMLElement;
114
+ pre: IHTMLElement;
115
+ progress: IHTMLElement;
116
+ q: IHTMLElement;
117
+ rb: IHTMLElement;
118
+ rp: IHTMLElement;
119
+ rt: IHTMLElement;
120
+ rtc: IHTMLElement;
121
+ ruby: IHTMLElement;
122
+ s: IHTMLElement;
123
+ samp: IHTMLElement;
124
+ section: IHTMLElement;
125
+ select: IHTMLSelectElement;
126
+ small: IHTMLElement;
127
+ source: IHTMLElement;
128
+ span: IHTMLElement;
129
+ strong: IHTMLElement;
130
+ sub: IHTMLElement;
131
+ summary: IHTMLElement;
132
+ sup: IHTMLElement;
133
+ table: IHTMLElement;
134
+ tbody: IHTMLElement;
135
+ td: IHTMLElement;
136
+ tfoot: IHTMLElement;
137
+ th: IHTMLElement;
138
+ thead: IHTMLElement;
139
+ time: IHTMLElement;
140
+ title: IHTMLElement;
141
+ tr: IHTMLElement;
142
+ track: IHTMLElement;
143
+ u: IHTMLElement;
144
+ ul: IHTMLElement;
145
+ var: IHTMLElement;
146
+ video: IHTMLVideoElement;
147
+ wbr: IHTMLElement;
148
+ }
@@ -0,0 +1,67 @@
1
+ import ISVGSVGElement from '../nodes/svg-element/ISVGSVGElement.js';
2
+ import ISVGElement from '../nodes/svg-element/ISVGElement.js';
3
+
4
+ export default interface ISVGElementTagNameMap {
5
+ svg: ISVGSVGElement;
6
+ animate: ISVGElement;
7
+ animateMotion: ISVGElement;
8
+ animateTransform: ISVGElement;
9
+ circle: ISVGElement;
10
+ clipPath: ISVGElement;
11
+ defs: ISVGElement;
12
+ desc: ISVGElement;
13
+ ellipse: ISVGElement;
14
+ feBlend: ISVGElement;
15
+ feColorMatrix: ISVGElement;
16
+ feComponentTransfer: ISVGElement;
17
+ feComposite: ISVGElement;
18
+ feConvolveMatrix: ISVGElement;
19
+ feDiffuseLighting: ISVGElement;
20
+ feDisplacementMap: ISVGElement;
21
+ feDistantLight: ISVGElement;
22
+ feDropShadow: ISVGElement;
23
+ feFlood: ISVGElement;
24
+ feFuncA: ISVGElement;
25
+ feFuncB: ISVGElement;
26
+ feFuncG: ISVGElement;
27
+ feFuncR: ISVGElement;
28
+ feGaussianBlur: ISVGElement;
29
+ feImage: ISVGElement;
30
+ feMerge: ISVGElement;
31
+ feMergeNode: ISVGElement;
32
+ feMorphology: ISVGElement;
33
+ feOffset: ISVGElement;
34
+ fePointLight: ISVGElement;
35
+ feSpecularLighting: ISVGElement;
36
+ feSpotLight: ISVGElement;
37
+ feTile: ISVGElement;
38
+ feTurbulence: ISVGElement;
39
+ filter: ISVGElement;
40
+ foreignObject: ISVGElement;
41
+ g: ISVGElement;
42
+ image: ISVGElement;
43
+ line: ISVGElement;
44
+ linearGradient: ISVGElement;
45
+ marker: ISVGElement;
46
+ mask: ISVGElement;
47
+ metadata: ISVGElement;
48
+ mpath: ISVGElement;
49
+ path: ISVGElement;
50
+ pattern: ISVGElement;
51
+ polygon: ISVGElement;
52
+ polyline: ISVGElement;
53
+ radialGradient: ISVGElement;
54
+ rect: ISVGElement;
55
+ script: ISVGElement;
56
+ set: ISVGElement;
57
+ stop: ISVGElement;
58
+ style: ISVGElement;
59
+ switch: ISVGElement;
60
+ symbol: ISVGElement;
61
+ text: ISVGElement;
62
+ textPath: ISVGElement;
63
+ title: ISVGElement;
64
+ tspan: ISVGElement;
65
+ use: ISVGElement;
66
+ view: ISVGElement;
67
+ }
@@ -0,0 +1,25 @@
1
+ import Event from '../Event.js';
2
+ import IHashChangeEventInit from './IHashChangeEventInit.js';
3
+
4
+ /**
5
+ * Hash change event.
6
+ *
7
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HashChangeEvent
8
+ */
9
+ export default class HashChangeEvent extends Event {
10
+ public readonly newURL: string;
11
+ public readonly oldURL: string;
12
+
13
+ /**
14
+ * Constructor.
15
+ *
16
+ * @param type Event type.
17
+ * @param [eventInit] Event init.
18
+ */
19
+ constructor(type: string, eventInit: IHashChangeEventInit | null = null) {
20
+ super(type, eventInit);
21
+
22
+ this.newURL = eventInit?.newURL ?? '';
23
+ this.oldURL = eventInit?.oldURL ?? '';
24
+ }
25
+ }
@@ -0,0 +1,6 @@
1
+ import IEventInit from '../IEventInit.js';
2
+
3
+ export default interface IHashChangeEventInit extends IEventInit {
4
+ newURL?: string;
5
+ oldURL?: string;
6
+ }
@@ -102,7 +102,7 @@ export default class Fetch {
102
102
  * @returns Response.
103
103
  */
104
104
  public async send(): Promise<IResponse> {
105
- FetchRequestReferrerUtility.prepareRequest(this.#window.location, this.request);
105
+ FetchRequestReferrerUtility.prepareRequest(new URL(this.#window.location.href), this.request);
106
106
  FetchRequestValidationUtility.validateSchema(this.request);
107
107
 
108
108
  if (this.request.signal.aborted) {
@@ -247,7 +247,7 @@ export default class Fetch {
247
247
  private async compliesWithCrossOriginPolicy(): Promise<boolean> {
248
248
  if (
249
249
  this.disableCrossOriginPolicy ||
250
- !FetchCORSUtility.isCORS(this.#window.location, this.request[PropertySymbol.url])
250
+ !FetchCORSUtility.isCORS(this.#window.location.href, this.request[PropertySymbol.url])
251
251
  ) {
252
252
  return true;
253
253
  }
@@ -714,7 +714,7 @@ export default class Fetch {
714
714
  if (
715
715
  this.request.credentials === 'omit' ||
716
716
  (this.request.credentials === 'same-origin' &&
717
- FetchCORSUtility.isCORS(this.#window.location, locationURL))
717
+ FetchCORSUtility.isCORS(this.#window.location.href, locationURL))
718
718
  ) {
719
719
  headers.delete('authorization');
720
720
  headers.delete('www-authenticate');
@@ -121,9 +121,9 @@ export default class Request implements IRequest {
121
121
  } else {
122
122
  try {
123
123
  if (input instanceof Request && input.url) {
124
- this[PropertySymbol.url] = new URL(input.url, injected.window.location);
124
+ this[PropertySymbol.url] = new URL(input.url, injected.window.location.href);
125
125
  } else {
126
- this[PropertySymbol.url] = new URL(<string>input, injected.window.location);
126
+ this[PropertySymbol.url] = new URL(<string>input, injected.window.location.href);
127
127
  }
128
128
  } catch (error) {
129
129
  throw new DOMException(
@@ -86,7 +86,7 @@ export default class SyncFetch {
86
86
  * @returns Response.
87
87
  */
88
88
  public send(): ISyncResponse {
89
- FetchRequestReferrerUtility.prepareRequest(this.#window.location, this.request);
89
+ FetchRequestReferrerUtility.prepareRequest(new URL(this.#window.location.href), this.request);
90
90
  FetchRequestValidationUtility.validateSchema(this.request);
91
91
 
92
92
  if (this.request.signal.aborted) {
@@ -231,7 +231,7 @@ export default class SyncFetch {
231
231
  private compliesWithCrossOriginPolicy(): boolean {
232
232
  if (
233
233
  this.disableCrossOriginPolicy ||
234
- !FetchCORSUtility.isCORS(this.#window.location, this.request[PropertySymbol.url])
234
+ !FetchCORSUtility.isCORS(this.#window.location.href, this.request[PropertySymbol.url])
235
235
  ) {
236
236
  return true;
237
237
  }
@@ -512,7 +512,7 @@ export default class SyncFetch {
512
512
  if (
513
513
  this.request.credentials === 'omit' ||
514
514
  (this.request.credentials === 'same-origin' &&
515
- FetchCORSUtility.isCORS(this.#window.location, locationURL))
515
+ FetchCORSUtility.isCORS(this.#window.location.href, locationURL))
516
516
  ) {
517
517
  headers.delete('authorization');
518
518
  headers.delete('www-authenticate');
@@ -6,6 +6,7 @@ import Headers from '../Headers.js';
6
6
  import Request from '../Request.js';
7
7
  import IHeaders from '../types/IHeaders.js';
8
8
  import FetchCORSUtility from './FetchCORSUtility.js';
9
+ import { URL } from 'url';
9
10
 
10
11
  const FORBIDDEN_HEADER_NAMES = [
11
12
  'accept-charset',
@@ -77,10 +78,8 @@ export default class FetchRequestHeaderUtility {
77
78
  request: Request;
78
79
  }): { [key: string]: string } {
79
80
  const headers = new Headers(options.request.headers);
80
- const isCORS = FetchCORSUtility.isCORS(
81
- options.window.location,
82
- options.request[PropertySymbol.url]
83
- );
81
+ const originURL = new URL(options.window.location.href);
82
+ const isCORS = FetchCORSUtility.isCORS(originURL, options.request[PropertySymbol.url]);
84
83
 
85
84
  // TODO: Maybe we need to add support for OPTIONS request with 'Access-Control-Allow-*' headers?
86
85
  if (
@@ -107,7 +106,7 @@ export default class FetchRequestHeaderUtility {
107
106
  (options.request.credentials === 'same-origin' && !isCORS)
108
107
  ) {
109
108
  const cookies = options.browserFrame.page.context.cookieContainer.getCookies(
110
- options.window.location,
109
+ originURL,
111
110
  false
112
111
  );
113
112
  if (cookies.length > 0) {
@@ -55,7 +55,8 @@ export default class FetchRequestReferrerUtility {
55
55
  if (referrer === '' || referrer === 'no-referrer' || referrer === 'client') {
56
56
  return referrer;
57
57
  } else if (referrer) {
58
- const referrerURL = referrer instanceof URL ? referrer : new URL(referrer, window.location);
58
+ const referrerURL =
59
+ referrer instanceof URL ? referrer : new URL(referrer, window.location.href);
59
60
  return referrerURL.origin === window.location.origin ? referrerURL : 'client';
60
61
  }
61
62
 
@@ -59,7 +59,7 @@ export default class FormData implements Iterable<[string, string | File]> {
59
59
  this.append(node.name, file);
60
60
  }
61
61
  }
62
- } else {
62
+ } else if (node.value) {
63
63
  this.append(node.name, node.value);
64
64
  }
65
65
  }
@@ -73,7 +73,7 @@ export default class FormData implements Iterable<[string, string | File]> {
73
73
  *
74
74
  * @param callback Callback.
75
75
  */
76
- public forEach(callback: (key: string, value: string | File, thisArg: FormData) => void): void {
76
+ public forEach(callback: (value: string | File, key: string, thisArg: FormData) => void): void {
77
77
  for (const entry of this.#entries) {
78
78
  callback.call(this, entry.value, entry.name, this);
79
79
  }
package/src/index.ts CHANGED
@@ -40,8 +40,10 @@ import ClipboardEvent from './event/events/ClipboardEvent.js';
40
40
  import CustomEvent from './event/events/CustomEvent.js';
41
41
  import ErrorEvent from './event/events/ErrorEvent.js';
42
42
  import FocusEvent from './event/events/FocusEvent.js';
43
+ import HashChangeEvent from './event/events/HashChangeEvent.js';
43
44
  import InputEvent from './event/events/InputEvent.js';
44
45
  import KeyboardEvent from './event/events/KeyboardEvent.js';
46
+ import MediaQueryListEvent from './event/events/MediaQueryListEvent.js';
45
47
  import MouseEvent from './event/events/MouseEvent.js';
46
48
  import ProgressEvent from './event/events/ProgressEvent.js';
47
49
  import SubmitEvent from './event/events/SubmitEvent.js';
@@ -115,7 +117,7 @@ import Storage from './storage/Storage.js';
115
117
  import NodeFilter from './tree-walker/NodeFilter.js';
116
118
  import NodeIterator from './tree-walker/NodeIterator.js';
117
119
  import TreeWalker from './tree-walker/TreeWalker.js';
118
- import Location from './url/Location.js';
120
+ import Location from './location/Location.js';
119
121
  import URL from './url/URL.js';
120
122
  import BrowserWindow from './window/BrowserWindow.js';
121
123
  import GlobalWindow from './window/GlobalWindow.js';
@@ -138,8 +140,10 @@ import type IClipboardEventInit from './event/events/IClipboardEventInit.js';
138
140
  import type ICustomEventInit from './event/events/ICustomEventInit.js';
139
141
  import type IErrorEventInit from './event/events/IErrorEventInit.js';
140
142
  import type IFocusEventInit from './event/events/IFocusEventInit.js';
143
+ import type IHashChangeEventInit from './event/events/IHashChangeEventInit.js';
141
144
  import type IInputEventInit from './event/events/IInputEventInit.js';
142
145
  import type IKeyboardEventInit from './event/events/IKeyboardEventInit.js';
146
+ import type IMediaQueryListInit from './event/events/IMediaQueryListInit.js';
143
147
  import type IMouseEventInit from './event/events/IMouseEventInit.js';
144
148
  import type IProgressEventInit from './event/events/IProgressEventInit.js';
145
149
  import type ISubmitEventInit from './event/events/ISubmitEventInit.js';
@@ -237,9 +241,11 @@ export type {
237
241
  IHTMLTemplateElement,
238
242
  IHTMLTextAreaElement,
239
243
  IHTMLVideoElement,
244
+ IHashChangeEventInit,
240
245
  IHeaders,
241
246
  IInputEventInit,
242
247
  IKeyboardEventInit,
248
+ IMediaQueryListInit,
243
249
  IMouseEventInit,
244
250
  INode,
245
251
  INodeList,
@@ -388,12 +394,14 @@ export {
388
394
  HTMLElement as HTMLUListElement,
389
395
  HTMLUnknownElement,
390
396
  HTMLVideoElement,
397
+ HashChangeEvent,
391
398
  Headers,
392
399
  History,
393
400
  Image,
394
401
  InputEvent,
395
402
  KeyboardEvent,
396
403
  Location,
404
+ MediaQueryListEvent,
397
405
  MouseEvent,
398
406
  MutationObserver,
399
407
  MutationRecord,