Repository navigation
Added
- The floating button is a split pill: PDF exports, the ⚙ half opens a PDF
options card (same style as the progress card) with colours, paper size (A4 / Letter
/ chosen in the dialog), orientation, margins (normal / narrow / none), text size,
header on/off, images on/off, the ⌘P / Ctrl+P takeover, reset button position and a
Save PDF button. Paper, orientation and margins are written as an@pagerule only
while a print is staged. - Userscript-manager menu: PDF options… (the individual toggles moved into the card).
Changed
- ChatGPT printed a blank PDF: on
beforeprintChatGPT mounts its own print document,
and itsbody:has(> .printDocument) > :not(.printDocument) { display: none !important }
rule sits in a cascade layer, which outranks an unlayered!important. The script's
beforeprintlistener (registered at document-start) now stops the sites' print
handlers while it prints, the page is hidden with inline!importantstyles, and
anything mounted into<body>during the print is hidden as well. - Gemini lines overlapped and the end of the chat was cut: Chrome split tall column
flexboxes badly across pages. Each copied message is now rewritten from the live
computed layout — tall column flex / stacked grid containers become blocks (child
alignment, gaps and blockified display kept), inline wrappers around in-flow blocks
become blocks, scroll boxes getoverflow: visible, masks and sticky/fixed
positioning are dropped. Gemini's fade mask on the chat scroller no longer reaches the
PDF. - Claude's chat sat in a narrow column on one side: the outer app wrappers carried the
sidebar width aspadding-left. Wrappers at or above the chat's scroll container now
lose their side padding and margins in the copy. - Claude's answer action bar (copy / read aloud / rating / retry) was printed: its icons
are icon-font glyphs, so the buttons were not empty. Private-use and format characters
no longer count as button text, and buttons whosearia-labelis a known action are
dropped too. - Grok code blocks were light text on a light background after switching to the light
theme (tokens coloured for dark only). Code blocks where both the text and the
background are light get a dark background in the PDF. - Colours are read through a 1×1 canvas, so
oklch()/color()values are understood;
plainrgb()parsing is the fallback when canvas reads are blocked. - The fallback stylesheet (managers without
GM_addStyle) waits for<html>to exist
instead of throwing at document-start.
Install
With Tampermonkey, Violentmonkey or ScriptCat installed, open:
https://github.com/RobyRew/Download-AI-Chat-PDF/releases/latest/download/download-ai-chat-pdf.user.js