Taking screenshot is not possible if the page is still loading
Reported by
rhour...@gmail.com,
Nov 30
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0 Steps to reproduce the problem: I have created a small extension that takes screenshots using both `Page.captureScreenshot` and `captureVisibleTab` calls which behave similarly here. I also attached a page with a reference to a jsp page that sleeps for few seconds to simulate a slow resource. The test should be ran on Tomcat if possible (or create your own reproducing page with very slow resource in the head). 1. Install the attached extension in chrome browser and open the background console window to be able to see logs of the function call time and callback time. 2. Navigate to a page with slow resources in the head (in this case slowHead.html) 3. Click on the camera icon to take a screenshot. ** In the console you can see the time before and after the screenshot call. Usually, it's milliseconds. If the page is loading then it takes as long as the page loads. 4. The extension opens a new tab after the result is received from the `Page.captureScreenshot` with the screenshot image. What is the expected behavior? I have a chrome extension that usually loads pages and takes screenshot after a certain time. I would expect to get a white page if the page is not loaded at that time. Instead, I have to wait until the page is loaded to do so. What went wrong? I first noticed the problem when some of the pages I wanted to take a screenshot of where loading resources from a different country and were too slow which caused the screenshot callback to take 3 minutes before it got executed. I think there's some kind of timeout as 3 minutes here. Did this work before? N/A Chrome version: 71.0.3578.75 (Official Build) beta (64-bit) (cohort: Beta) Channel: n/a OS Version: 10.0 Flash Version: Shockwave Flash 26.0 r0 I'm not really sure if this worked before but I remember taking white screenshots of pages that were not loaded yet. Does this not work anymore? Is it intended to not get any screenshot until the page is loaded? Is it possible to get any other value that represents that the page is still loading like null or undefined? Or a white screenshot?
,
Nov 30
Thanks for the quick response. Here's a new test page. I hope this one works easily.
,
Nov 30
Bisect info: 343341 (good) - 343346 (bad) https://chromium.googlesource.com/chromium/src/+log/46697883..c3cb7b5f?pretty=fuller Suspecting df0826d81caa0d80997537ac6316a31b1ca77ab0 "Don't resume commits after every layout." Landed in 46.0.2483.0 via r343343
,
Nov 30
,
Dec 4
Likely the extension issue.
,
Dec 5
re 5 - please reopen and let someone perform a proper investigation. If you look at the extension code (and do a quick debugging), you'll see it simply sends Page.captureScreenshot via chrome.debugger API and gets no result back in the newer builds after the range bisected in #3.
,
Dec 5
Reporter, I guess you'll have to re-submit the issue because there's no one in CC/Owner fields so no one will see the new comments. And this time don't set Platform>DevTools component as it's not relevant here.
,
Dec 5
Thank you for your help. I reopen a new issue. What component should it have?
,
Dec 5
Platform>Extensions>API I guess.
,
Dec 5
I couldn't find that platform listed in the options when I opened the issue. Here's a link to the new one https://bugs.chromium.org/p/chromium/issues/detail?id=912020 |
|||
►
Sign in to add a comment |
|||
Comment 1 by woxxom@gmail.com
, Nov 30