Skip to content

Instantly share code, notes, and snippets.

@matthewsimo
Last active June 22, 2022 22:04
Show Gist options
  • Select an option

  • Save matthewsimo/f3168051eaf470db63a15def8e76df38 to your computer and use it in GitHub Desktop.

Select an option

Save matthewsimo/f3168051eaf470db63a15def8e76df38 to your computer and use it in GitHub Desktop.

Revisions

  1. matthewsimo revised this gist Jun 22, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,7 @@ const { chromium } = require("playwright"); // Or 'chromium' or 'firefox'.
    });
    const page = await context.newPage();
    await page.goto("http://localhost:3000/basic");
    await page.waitForLoadState("domcontentloaded");
    await page.screenshot({ path: "webgpu.png", fullPage: true });
    await page.waitForTimeout(3000);
    await browser.close();
  2. matthewsimo created this gist Jun 22, 2022.
    31 changes: 31 additions & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    const { chromium } = require("playwright"); // Or 'chromium' or 'firefox'.


    (async () => {
    const browser = await chromium.launch({
    channel: "chrome-canary",
    args: ["--enable-unsafe-webgpu"],
    headless: false,
    });
    const context = await browser.newContext({
    recordVideo: {
    dir: "videos/",
    size: {
    width: 1024,
    height: 1024,
    },
    },
    viewport: {
    width: 1024,
    height: 1024,
    },
    });
    const page = await context.newPage();
    await page.goto("http://localhost:3000/basic");
    await page.screenshot({ path: "webgpu.png", fullPage: true });
    await page.waitForTimeout(3000);
    await browser.close();

    })();

    // Then run `ffmpeg -i videos/[file].webm video.mp4` to turn to mp4