chromedp / cdproto

Package cdproto contains the generated commands, types, and events for the Chrome DevTools Protocol domains.
MIT License
149 stars 54 forks source link

Modify withHeaderTemplate hint #13

Closed nayakunin closed 3 years ago

nayakunin commented 4 years ago

https://github.com/chromedp/cdproto/blob/d1f6fc58448b0ca91a99956f311b951fd1b3378d/page/page.go#L812 Hi, hint for this function says, that it is enough to pass <span class=title></span> to it and it will work. But actually it won't unless you add font size. It wasn't clear for me and I couldn't find any info for a long time. So, please add some mention of that fact in description if possible.

ZekeLu commented 3 years ago

@nayakunin Thank you for sharing!

The doc string is generated from the upstream protocol definitions (which is https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/core/inspector/browser_protocol.pdl). It's better to let the upstream fix it.

Besides that, I found that the configuration of the PDF layout is a little complicated (see how puppeteer handle it). It's more helpful to provide a full demo to show how to configure the layout.

Issues should not be created for this repository. I'm closing this issue now. If you have a demo to share, please file a issue to https://github.com/chromedp/chromedp and post your demo there, or better, to improve the example https://github.com/chromedp/examples/blob/master/pdf/main.go. Thank you very much!