mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 03:41:28 +00:00
The bundled pages took two facts from the User-Agent header: whether the app
is in dark mode ("dark") and whether they run inside OrcaSlicer at all
("BBL-Slicer", the gate on every message they post to the host). That made
the header carry application state. #15104 switched Linux to WebKitGTK's own
header so that Cloudflare accepts third-party print-host pages, and with it
the home page came up light on a dark app and New Project, Open Project, the
Project tab, the wizard and the web dialogs stopped reaching the host.
The host now tells each page its theme through a document-start user script
(window.__orcaTheme), added when the view is created, again on a theme change
before the reload, and after PrinterWebView clears its user scripts. The page
tests for the injected window.wx bridge instead of the header, which is what
the plugin pages already do. Nothing reads the header any more, so Linux
keeps sending WebKitGTK's own on every view. Windows and macOS keep the
headers they always sent: the Windows wrapper still derives WebView2's colour
scheme from it.
Four copies of the helper file lived next to the pages that used them
(homepage/js, guide/js, dialog/js, include), differing only in the relative
path each one passed to its dark.css toggle. The toggle now switches whichever
dark.css the page already links, so the one copy in include/ serves all 17
pages and the other three are gone. That file was stored with CRLF and is
normalised to LF, which is most of its diff.