function OnScreenshotCaptured not called
Reported by
ankur_se...@ql2.com,
Jul 26
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Steps to reproduce the problem: Hi Team, I am using headless browser from c++ code. My requirement is to take page screenshot. Following is the code called from OnPageReady(): devtools_client_->GetEmulation()->GetExperimental()->SetVisibleSize(headless::emulation::SetVisibleSizeParams::Builder() .SetHeight(900) .SetWidth(900) .Build()); devtools_client_->GetEmulation()->SetDeviceMetricsOverride(900, 900, 1, false); devtools_client_->GetEmulation()->GetExperimental()->SetPageScaleFactor(headless::emulation::SetPageScaleFactorParams::Builder() .SetPageScaleFactor(1).Build()); devtools_client_->GetPage()->GetExperimental()->CaptureScreenshot( headless::page::CaptureScreenshotParams::Builder() .SetClip(headless::page::Viewport::Builder() .SetX(0) .SetY(0) .SetScale(1) .SetHeight(900) .SetWidth(900) .Build()) .SetFormat(headless::page::CaptureScreenshotFormat::PNG) .SetFromSurface(true) .Build(), base::Bind(&HeadlessExample::OnScreenshotCaptured, weak_factory_.GetWeakPtr())); But my issue is that OnScreenshotCaptured function does not get called. Please help. Ankur Sehgal. What is the expected behavior? function OnScreenshotCaptured should get invoked What went wrong? function OnScreenshotCaptured not called Did this work before? N/A Chrome version: 67.0.3396.99 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Jul 26
There's a similar code in headless_shell (https://cs.chromium.org/chromium/src/headless/app/headless_shell.cc?rcl=17cb8dcddcc0dbbbd2d3d1022f3f5f5d15f0f800&l=437) that you can try passing --screenshot flag to headless_shell. Does it work for your page?
,
Jul 27
My requirement is to call CaptureScreenshot from my C++ code. In that case the function OnScreenshotCaptured does not get called. The control does not go in that function.
,
Jul 27
Well, we can't help with troubleshooting of your code unless you provide a functioning snippet of your code, hence I was suggesting that you try a similar scenario with the existing code.
,
Dec 20
This functionality works as intended in our tests and in other known usages, so closing because we can't reproduce. |
|||
►
Sign in to add a comment |
|||
Comment 1 by dtapu...@chromium.org
, Jul 26