Provider — PuppeteerSharp (Chromium)
Granit.Browsing.PuppeteerSharp is the Chromium provider. It owns the
PDF-heavy capabilities (IPdfCapability, IPdfViewerCapability,
IAccessibilityCapability) and is the recommended pick for HTML→PDF and
PDF-rasterisation workloads.
What the hardening pass changed
Section titled “What the hardening pass changed”RequestRouteradoption. The PuppeteerRequestevent is now owned by a singleRequestRouterper page. Sandbox handlers run first; userRouteAsyncregistrations run in order. See Browsing security — RequestRouter.- Integrity-pinned
BrowserFetcher.PuppeteerChromiumProvisionServicerefuses to run in production by default. When it does run (dev / staging viaGranit:Browsing:PuppeteerSharp:AllowFetcherInProduction = trueor a detected non-Production environment), it verifies the downloaded archive SHA-256 against the pinned manifest before extraction. A mismatch is a boot-fail. - Executable path allowlist. When
ChromiumExecutablePathis set, it must start withIBrowserSandboxProfile.AllowedExecutablePathPrefix(default:/usr/bin/,/opt/google/chrome/,/snap/bin/chromium/). An arbitrary path is refused at boot. --no-sandboxguard.PrivilegedFlagGuardevaluates theDisableSandboxoption against the container + uid + env-opt-in matrix.- PDF viewer via
ITempFileFactory. The PDF bytes are written to a0600temp file withDeleteOnClose, thenNavigateAsync(file://...)with the framework-internalGranit.Browsing.Pages.UseFileSchemegrant. - Volatile
_browserfield. The provider’s_browserfield is nowvolatileand read once into a local before dispose to prevent the double-dispose / null-deref race the audit flagged (VULN-206). - Logged disposal catches. Disposal exceptions are caught and
LogWarning-ed via[LoggerMessage]— they no longer poison the host shutdown.
Production configuration
Section titled “Production configuration”{ "Granit": { "Browsing": { "PuppeteerSharp": { "ChromiumExecutablePath": "/usr/bin/chromium", "SkipChromiumDownload": true, "DisableSandbox": false, "AllowFetcherInProduction": false } } }}Don’t ship a downloaded browser in production.
BrowserFetcherrunning at boot in production is refused by default. Bundle Chromium into the container image at build time and point at it viaChromiumExecutablePath. The fetcher exists for dev/staging convenience.
Executable path allowlist
Section titled “Executable path allowlist”services.AddSingleton<IBrowserSandboxProfile>(new SandboxProfile{ AllowedExecutablePathPrefix = "/opt/granit/chromium/",});ChromiumExecutablePath must start with the prefix. Useful for hosts that
ship a custom Chromium build under a non-standard path.