happy-dom 20.0.9 → 20.0.11
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.
- package/lib/browser/utilities/BrowserFrameFactory.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameFactory.js +8 -0
- package/lib/browser/utilities/BrowserFrameFactory.js.map +1 -1
- package/lib/event/EventTarget.d.ts +4 -0
- package/lib/event/EventTarget.d.ts.map +1 -1
- package/lib/event/EventTarget.js +9 -0
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/fetch/Fetch.d.ts.map +1 -1
- package/lib/fetch/Fetch.js +0 -2
- package/lib/fetch/Fetch.js.map +1 -1
- package/lib/fetch/SyncFetch.d.ts.map +1 -1
- package/lib/fetch/SyncFetch.js +0 -2
- package/lib/fetch/SyncFetch.js.map +1 -1
- package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts.map +1 -1
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js +4 -6
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -1
- package/lib/nodes/node/Node.d.ts +4 -0
- package/lib/nodes/node/Node.d.ts.map +1 -1
- package/lib/nodes/node/Node.js +28 -0
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/window/BrowserWindow.d.ts.map +1 -1
- package/lib/window/BrowserWindow.js +5 -9
- package/lib/window/BrowserWindow.js.map +1 -1
- package/package.json +1 -1
- package/src/browser/utilities/BrowserFrameFactory.ts +10 -0
- package/src/event/EventTarget.ts +10 -0
- package/src/fetch/Fetch.ts +0 -2
- package/src/fetch/SyncFetch.ts +0 -2
- package/src/fetch/utilities/FetchRequestHeaderUtility.ts +3 -9
- package/src/nodes/node/Node.ts +35 -0
- package/src/window/BrowserWindow.ts +7 -10
|
@@ -86,15 +86,6 @@ export default class FetchRequestHeaderUtility {
|
|
|
86
86
|
const originURL = new URL(options.window.location.href);
|
|
87
87
|
const isCORS = FetchCORSUtility.isCORS(originURL, options.request[PropertySymbol.url]);
|
|
88
88
|
|
|
89
|
-
// TODO: Maybe we need to add support for OPTIONS request with 'Access-Control-Allow-*' headers?
|
|
90
|
-
if (
|
|
91
|
-
options.request.credentials === 'omit' ||
|
|
92
|
-
(options.request.credentials === 'same-origin' && isCORS)
|
|
93
|
-
) {
|
|
94
|
-
headers.delete('authorization');
|
|
95
|
-
headers.delete('www-authenticate');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
89
|
headers.set('Accept-Encoding', 'gzip, deflate, br');
|
|
99
90
|
headers.set('Connection', 'close');
|
|
100
91
|
|
|
@@ -117,6 +108,9 @@ export default class FetchRequestHeaderUtility {
|
|
|
117
108
|
if (cookies.length > 0) {
|
|
118
109
|
headers.set('Cookie', CookieStringUtility.cookiesToString(cookies));
|
|
119
110
|
}
|
|
111
|
+
} else {
|
|
112
|
+
headers.delete('Cookie');
|
|
113
|
+
headers.delete('Cookie2');
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
if (!headers.has('Accept')) {
|
package/src/nodes/node/Node.ts
CHANGED
|
@@ -1065,6 +1065,41 @@ export default class Node extends EventTarget {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
+
/**
|
|
1069
|
+
* Destroys the node.
|
|
1070
|
+
*/
|
|
1071
|
+
public [PropertySymbol.destroy](): void {
|
|
1072
|
+
super[PropertySymbol.destroy]();
|
|
1073
|
+
|
|
1074
|
+
this[PropertySymbol.isConnected] = false;
|
|
1075
|
+
|
|
1076
|
+
while (this[PropertySymbol.nodeArray].length > 0) {
|
|
1077
|
+
const node = this[PropertySymbol.nodeArray][this[PropertySymbol.nodeArray].length - 1];
|
|
1078
|
+
|
|
1079
|
+
// Makes sure that something won't be triggered by the disconnect.
|
|
1080
|
+
if ((<any>node).disconnectedCallback) {
|
|
1081
|
+
delete (<any>node).disconnectedCallback;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
this[PropertySymbol.removeChild](node);
|
|
1085
|
+
node[PropertySymbol.destroy]();
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
this[PropertySymbol.parentNode] = null;
|
|
1089
|
+
this[PropertySymbol.rootNode] = null;
|
|
1090
|
+
this[PropertySymbol.styleNode] = null;
|
|
1091
|
+
this[PropertySymbol.textAreaNode] = null;
|
|
1092
|
+
this[PropertySymbol.formNode] = null;
|
|
1093
|
+
this[PropertySymbol.selectNode] = null;
|
|
1094
|
+
this[PropertySymbol.mutationListeners] = [];
|
|
1095
|
+
this[PropertySymbol.nodeArray] = [];
|
|
1096
|
+
this[PropertySymbol.elementArray] = [];
|
|
1097
|
+
this[PropertySymbol.childNodes] = null;
|
|
1098
|
+
this[PropertySymbol.assignedToSlot] = null;
|
|
1099
|
+
|
|
1100
|
+
this[PropertySymbol.clearCache]();
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1068
1103
|
/**
|
|
1069
1104
|
* Reports the position of its argument node relative to the node on which it is called.
|
|
1070
1105
|
*
|
|
@@ -1884,6 +1884,8 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
|
|
|
1884
1884
|
return;
|
|
1885
1885
|
}
|
|
1886
1886
|
|
|
1887
|
+
super[PropertySymbol.destroy]();
|
|
1888
|
+
|
|
1887
1889
|
(<boolean>this.closed) = true;
|
|
1888
1890
|
|
|
1889
1891
|
const mutationObservers = this[PropertySymbol.mutationObservers];
|
|
@@ -1896,16 +1898,7 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
|
|
|
1896
1898
|
|
|
1897
1899
|
this[PropertySymbol.mutationObservers] = [];
|
|
1898
1900
|
|
|
1899
|
-
|
|
1900
|
-
const childNodes = this.document[PropertySymbol.nodeArray];
|
|
1901
|
-
|
|
1902
|
-
while (childNodes.length > 0) {
|
|
1903
|
-
// Makes sure that something won't be triggered by the disconnect.
|
|
1904
|
-
if ((<HTMLElement>childNodes[0]).disconnectedCallback) {
|
|
1905
|
-
delete (<HTMLElement>childNodes[0]).disconnectedCallback;
|
|
1906
|
-
}
|
|
1907
|
-
this.document[PropertySymbol.removeChild](childNodes[0]);
|
|
1908
|
-
}
|
|
1901
|
+
this.document[PropertySymbol.destroy]();
|
|
1909
1902
|
|
|
1910
1903
|
// Create some empty elements for scripts that are still running.
|
|
1911
1904
|
const htmlElement = this.document.createElement('html');
|
|
@@ -1940,6 +1933,10 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
|
|
|
1940
1933
|
this.document[PropertySymbol.currentScript] = null;
|
|
1941
1934
|
this.document[PropertySymbol.selection] = null;
|
|
1942
1935
|
|
|
1936
|
+
// Clear parent/top references to break circular references
|
|
1937
|
+
this[PropertySymbol.parent] = null;
|
|
1938
|
+
this[PropertySymbol.top] = null;
|
|
1939
|
+
|
|
1943
1940
|
WindowBrowserContext.removeWindowBrowserFrameRelation(this);
|
|
1944
1941
|
}
|
|
1945
1942
|
|