Skip to content

Add Sheets Print Fix for docs.google.com - #2

Open
vandenng wants to merge 1 commit into
yetanotherbrowser:mainfrom
vandenng:add-google-sheets-print-fix
Open

vandenng wants to merge 1 commit into
yetanotherbrowser:mainfrom
vandenng:add-google-sheets-print-fix

Conversation

@vandenng

Copy link
Copy Markdown

One plugin: plugins/google-sheets-print-fix (Page rung, docs.google.com).

What it fixes. In Yab, pressing Cmd+P in Google Sheets, choosing the print settings and pressing Next prints a picture of the screen instead of the formatted pages.

Why. When a print starts, Sheets appends <style class="offline-printing-css"> and <div class="printing-canvas-container"> (one canvas per page) to <body>, and removes both as soon as window.print() returns. In Yab window.print() returns straight away and the page is rendered a moment later, after Sheets has cleaned up. The plugin watches <body> for those two nodes and puts the same nodes back when Sheets removes them, keeps them off the screen with @media screen CSS, and removes them after afterprint and the next click or key (or after five minutes, or when a new print starts).

It reads nothing, stores nothing and makes no network calls. It only runs on /spreadsheets/ paths.

Checked.

  • npm run validate: valid.
  • node scripts/try-plugin.mjs google-sheets-print-fix: works live on the preview page (a public sheet, no sign-in needed). Printing cannot be driven from the checker, so scripts/trials/google-sheets-print-fix.mjs plays Sheets' part: adds the two nodes, removes them, and expects them back, hidden on screen, and gone after the print.
  • By hand in Yab on a real sheet: Cmd+P, settings, Next now shows and prints the formatted pages.

No review.json, since that is the reviewer's to add. If you would rather fix this in Yab's window.print() itself, that would make the plugin unnecessary, and I am glad to close this.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 24, 2026

Copy link
Copy Markdown

Your organization has run out of review credits. Add credits to resume code reviews.

@github-actions github-actions Bot added the second review needed New sites, permissions or owner label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

second review needed New sites, permissions or owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant