Blank/Broken Images with chrome.tabs.captureVisibleTab() ?

290 views
Skip to first unread message

John Beales

unread,
Jun 12, 2011, 2:55:55 AM6/12/11
to Chromium-extensions
Hello,

I'm running into a situation where captureVisibleTab() gives me an
empty image. Here's what I think is happening:

- I have several tabs and/or windows open.
- My extension switches to the tab that I want to capture, (I've tried
both simply switching to it in its existing window and moving it to a
new window where it's by itself).
- Even though the tab is completely loaded and has been rendered by
the browser it takes a moment before it's re-rendered on the screen.
During this time a white screen is displayed and an image of that
white screen is captured.
- The tab re-renders its contents, but too late.

I notice the white-screen phenomenon even when I'm browsing the web
sometimes, especially if I have a lot of tabs open or my computer's
been asleep for a while. It can take a very long time to render the
tabs that I have open when I switch to them.

So, is there a way of knowing if a tab has been re-rendered? I've
checked tab.status but it's not consistent.

At the moment I'm setting a timeout, but I would prefer to know when
the tab is visible so I don't have to guess how long it will take
under all different conditions.

Thanks!

John

Boris Smus

unread,
Jun 13, 2011, 12:32:51 PM6/13/11
to John Beales, Chromium-extensions
Due to a breaking change in M11:


You now need host permissions to use the captureVisibleTab. More info on this thread:


- Boris


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Boris Smus

unread,
Jun 13, 2011, 12:49:04 PM6/13/11
to John Beales, Chromium-extensions
Sounds like a bug with good repro steps! Could you file it on crbug.com?

Thanks,
- Boris

On Mon, Jun 13, 2011 at 9:43 AM, John Beales <johnb...@gmail.com> wrote:
I've got the permissions, and am able to capture the image if I wait, (around 1/2 second seems to be long enough at the moment), but if I do it very quickly, (instantly), after switching to the tab nothing is captured.

John

Boris Smus

unread,
Jun 13, 2011, 1:19:08 PM6/13/11
to John Beales, Chromium-extensions
Thanks John.

On Mon, Jun 13, 2011 at 9:58 AM, John Beales <johnb...@gmail.com> wrote:
The bug is submitted at: http://crbug.com/85926

On Monday, June 13, 2011 at 12:50 PM, Boris Smus wrote:

Thanks! Could you also post the crbug.com/NNN URL to the chromium group?

- Boris

On Mon, Jun 13, 2011 at 9:49 AM, John Beales <johnb...@gmail.com> wrote:
Will do. Thanks.
Reply all
Reply to author
Forward
0 new messages