Feature request
Expose the browser binary's --enable-external-stylesheets flag as an option on lightpanda.serve().
Context
The Lightpanda binary supports --enable-external-stylesheets as a common option of the serve subcommand (from lightpanda serve --help):
--enable-external-stylesheets
Fetch external <link rel=stylesheet> resources so their rules
contribute to computed styles (and therefore to visibility checks like
display, visibility, opacity, pointer-events).
However, LightpandaServeOptions currently only supports host, port, disableHostVerification, obeyRobots, and httpProxy, so there is no way to pass this flag when starting the CDP server through the npm package.
This matters for Playwright/CDP-based test automation: without external stylesheets, visibility checks (display, visibility, opacity, pointer-events) can produce different results than a regular browser, since rules from <link rel=stylesheet> never contribute to computed styles.
Proposed change
Add an enableExternalStylesheets?: boolean option to LightpandaServeOptions, mapped to the --enable-external-stylesheets flag (flag-only, same as obeyRobots → --obey-robots):
export type LightpandaServeOptions = {
host?: string;
port?: number;
disableHostVerification?: boolean;
obeyRobots?: boolean;
httpProxy?: string;
enableExternalStylesheets?: boolean;
};
This follows the same pattern as #5 (--obey-robots) and #9 (--dump markdown).
Happy to open a PR if this sounds good.
Feature request
Expose the browser binary's
--enable-external-stylesheetsflag as an option onlightpanda.serve().Context
The Lightpanda binary supports
--enable-external-stylesheetsas a common option of theservesubcommand (fromlightpanda serve --help):However,
LightpandaServeOptionscurrently only supportshost,port,disableHostVerification,obeyRobots, andhttpProxy, so there is no way to pass this flag when starting the CDP server through the npm package.This matters for Playwright/CDP-based test automation: without external stylesheets, visibility checks (
display,visibility,opacity,pointer-events) can produce different results than a regular browser, since rules from<link rel=stylesheet>never contribute to computed styles.Proposed change
Add an
enableExternalStylesheets?: booleanoption toLightpandaServeOptions, mapped to the--enable-external-stylesheetsflag (flag-only, same asobeyRobots→--obey-robots):This follows the same pattern as #5 (
--obey-robots) and #9 (--dump markdown).Happy to open a PR if this sounds good.