New issue
Advanced search Search tips

Issue 867804 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Dec 20
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

function OnScreenshotCaptured not called

Reported by ankur_se...@ql2.com, Jul 26

Issue description

UserAgent: 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:
 
Components: Platform>DevTools
Components: Internals>Headless
Labels: Needs-Feedback
Owner: caseq@chromium.org
Status: Assigned (was: Unconfirmed)
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?
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.


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.

Status: WontFix (was: Assigned)
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