-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestion: allow for transparent backgrounds in screenshots #23
Comments
One of my favorite parts of Astral is that it exposes the CDP bindings ("celestial" bindings) for the user to mess with. In this case, you could get the celestial bindings on a page and then make a call to the protocol directly. The bindings are fully typed! You can find the chrome protocol docs at https://chromedevtools.github.io/devtools-protocol/. I haven't tested it but something like: const browser = await launch();
const page = await browser.newPage();
const celestial = page.unsafelyGetCelestialBindings();
// use the emulation bindings to set the background color
await celestial.Emulation. setDefaultBackgroundColorOverride({r: 0, b: 0, g: 0, a: 0});
await page.goto("https://google.com");
Deno.writeFileSync("screenshot.png", await page.screenshot()); |
Cool thanks for the explanation and the doc link ! I searched quickly in astral but couldn't find it since in the screenshot puppeteer named their method |
See #16
The text was updated successfully, but these errors were encountered: