initial commit

This commit is contained in:
Tomáš Mládek 2024-09-15 17:04:35 +02:00
commit ab1a45730d
3 changed files with 1254 additions and 0 deletions

29
index.mts Normal file
View file

@ -0,0 +1,29 @@
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({
headless: false, // Show the browser window
defaultViewport: null, // Don't limit the viewport
args: ["--use-fake-ui-for-media-stream"], // Avoid asking for microphone and camera permissions
});
const page = await browser
.pages()
.then((pages) => pages[0] || browser.newPage());
await page.goto("https://meet.vpsfree.cz");
await page.locator("#enter_room_field").fill("parsifal-parsifal-parsifal");
await page.locator("#enter_room_button").click();
await page.waitForSelector("body");
await page.evaluate(() => {
document.querySelector("body")!.requestFullscreen();
});
browser.on("disconnected", () => {
process.exit(0);
});
setInterval(async () => {
if ((await browser.pages()).length === 0) {
process.exit(0);
}
}, 1000);

6
package.json Normal file
View file

@ -0,0 +1,6 @@
{
"dependencies": {
"puppeteer": "^23.3.0",
"tsx": "^4.19.1"
}
}

1219
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff