We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6be4618 commit 10a76d5Copy full SHA for 10a76d5
src/index.js
@@ -63,6 +63,7 @@ const defaultContext = {
63
64
const screenshotParams = z.object({
65
url: z.string().startsWith("/"),
66
+ color: z.enum(["light", "dark"]).default("light"),
67
headers: z.string().optional(), // JSON object
68
});
69
router.get(
@@ -71,6 +72,7 @@ router.get(
71
72
const query = await getValidatedQuery(event, screenshotParams.parse);
73
const context = await browser.newContext({
74
...defaultContext,
75
+ colorScheme: query.color,
76
extraHTTPHeaders: JSON.parse(query.headers ?? "{}"),
77
78
const page = await context.newPage();
0 commit comments