Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed header/footer option for Chrome 120 #42

Merged
merged 4 commits into from
Dec 12, 2023
Merged

changed header/footer option for Chrome 120 #42

merged 4 commits into from
Dec 12, 2023

Conversation

alpaca1thunder
Copy link
Contributor

Fixes #41

@mikepqr
Copy link
Owner

mikepqr commented Dec 12, 2023

Thanks!

Would be nice to keep backwards compatibility with older Chrome versions.

Can you keep the --print-to-pdf-no-header option too or does passing that option and the new one simultaneously break new versions?

If you can keep it then please do, and add a comment saying something like Keep both versions of this option for backwards compatibility, https://developer.chrome.com/docs/chromium/new-headless

@alpaca1thunder
Copy link
Contributor Author

Thanks!

Would be nice to keep backwards compatibility with older Chrome versions.

Can you keep the --print-to-pdf-no-header option too or does passing that option and the new one simultaneously break new versions?

If you can keep it then please do, and add a comment saying something like Keep both versions of this option for backwards compatibility, https://developer.chrome.com/docs/chromium/new-headless

Didn't even think about that, good call. Just adding the option seems to still work (as well as on Chromium 90), so I reverted + added it.

@mikepqr
Copy link
Owner

mikepqr commented Dec 12, 2023

Sorry, I confused you by posting on the original issue thread rather than this PR!

Can you please add that comment to resume.py (not to this PR)?

resume.py Show resolved Hide resolved
@@ -128,6 +128,7 @@ def write_pdf(html: str, prefix: str = "resume", chrome: str = "") -> None:
"--no-sandbox",
"--headless",
"--print-to-pdf-no-header",
"--no-pdf-header-footer",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep both versions of this option for backwards compatibility, https://developer.chrome.com/docs/chromium/new-headless.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking for a Python comment, i.e. a line starting with #, in the diff itself. Not a comment on github.com.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sorry again for the confusion. Should be in the latest commit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All set. Thank you for the contribution!

@mikepqr mikepqr merged commit 6a9525b into mikepqr:main Dec 12, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Headers & Footers on latest Chrome
2 participants