happy-dom 7.0.5 → 7.0.6
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.
- package/README.md +26 -6
- package/package.json +2 -2
package/README.md
CHANGED
@@ -84,11 +84,13 @@ The default Window class is a [VM context](https://nodejs.org/api/vm.html#vm_vm_
|
|
84
84
|
```javascript
|
85
85
|
import { Window } from 'happy-dom';
|
86
86
|
|
87
|
-
const window = new Window(
|
87
|
+
const window = new Window({
|
88
|
+
innerWidth: 1024,
|
89
|
+
innerHeight: 768,
|
90
|
+
url: 'http://localhost:8080'
|
91
|
+
});
|
88
92
|
const document = window.document;
|
89
93
|
|
90
|
-
window.location.href = 'http://localhost:8080';
|
91
|
-
|
92
94
|
document.write(`
|
93
95
|
<html>
|
94
96
|
<head>
|
@@ -143,11 +145,13 @@ The example below will show you how to setup a Node [VM context](https://nodejs.
|
|
143
145
|
```javascript
|
144
146
|
import { Window } from 'happy-dom';
|
145
147
|
|
146
|
-
const window = new Window(
|
148
|
+
const window = new Window({
|
149
|
+
innerWidth: 1024,
|
150
|
+
innerHeight: 768,
|
151
|
+
url: 'http://localhost:8080'
|
152
|
+
});
|
147
153
|
const document = window.document;
|
148
154
|
|
149
|
-
window.location.href = 'http://localhost:8080';
|
150
|
-
|
151
155
|
document.write(`
|
152
156
|
<html>
|
153
157
|
<head>
|
@@ -230,6 +234,22 @@ window.setTimeout(() => {
|
|
230
234
|
window.happyDOM.cancelAsync();
|
231
235
|
```
|
232
236
|
|
237
|
+
**setInnerWidth()**
|
238
|
+
|
239
|
+
Sets the property `window.innerWidth` and dispatches a "resize" event.
|
240
|
+
|
241
|
+
```javascript
|
242
|
+
window.happyDOM.setInnerWidth(1024);
|
243
|
+
```
|
244
|
+
|
245
|
+
**setInnerHeight()**
|
246
|
+
|
247
|
+
Sets the property `window.innerHeight` and dispatches a "resize" event.
|
248
|
+
|
249
|
+
```javascript
|
250
|
+
window.happyDOM.setInnerHeight(768);
|
251
|
+
```
|
252
|
+
|
233
253
|
|
234
254
|
|
235
255
|
# Performance
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "happy-dom",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.6",
|
4
4
|
"license": "MIT",
|
5
5
|
"homepage": "https://github.com/capricorn86/happy-dom",
|
6
6
|
"repository": "https://github.com/capricorn86/happy-dom",
|
@@ -75,5 +75,5 @@
|
|
75
75
|
"ts-jest": "^27.1.3",
|
76
76
|
"typescript": "^4.6.2"
|
77
77
|
},
|
78
|
-
"gitHead": "
|
78
|
+
"gitHead": "98a7c1dccdc0b5dd0bec2f78e2775bcb9e80edf8"
|
79
79
|
}
|