-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.js
More file actions
26 lines (23 loc) · 691 Bytes
/
Copy pathutil.js
File metadata and controls
26 lines (23 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async function minimize(page) {
const session = await page.target().createCDPSession();
const goods = await session.send("Browser.getWindowForTarget");
const { windowId } = goods;
await session.send("Browser.setWindowBounds", {
windowId,
bounds: { windowState: "minimized" },
});
return;
}
async function maximize(page) {
const session = await page.target().createCDPSession();
const goods = await session.send("Browser.getWindowForTarget");
const { windowId } = goods;
await session.send("Browser.setWindowBounds", {
windowId,
bounds: { windowState: "normal" },
});
}
module.exports = {
minimize,
maximize
}