Closed Bug 1178727 Opened 10 years ago Closed 10 years ago

Calling screenshotToDataURL on deviceActor on Firefox desktop returns grey image

Categories

(DevTools Graveyard :: WebIDE, defect)

38 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: kenneth, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 Steps to reproduce: When calling the screenshotToDataURL method on the deviceActor via the remote debugging protocol on Firefox 38.0.5 desktop. Actual results: A grey screenshot is returned instead of the actual page screenshot. This is probably related to https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/device.js#44, as the wrong Window is probably returned. Expected results: Screenshot of the given page or an error if the deviceActor isn't allowed to be used on desktop instances.
Device actor is most closely associated with WebIDE, but there isn't really a clear match for any component.
Component: Untriaged → Developer Tools: WebIDE
I am guessing you're calling the actor from some tool you've written? I tried to access the screenshot method via the place I know that it's exposed in the UI, which is WebIDE. WebIDE is not usually used to target the local browser, but it can be done: 1. In about:config, set devtools.webide.enableLocalRuntime to true. 2. Open WebIDE (Tools -> Web Developer -> WebIDE) 3. Open the right-hand menu in the toolbar (Select Runtime) 4. Choose Local Runtime 5. Open the right-hand menu in the toolbar again 6. Choose Screenshot When testing in 38.0.5, this method works for me. Can you describe your steps more precisely?
Flags: needinfo?(kenneth)
Thanks for the quick reply! Yes. I'm writing my own tool connecting to to Firefox over RDP using https://github.com/auchenberg/firefox-client/blob/master/lib/device.js#L11 (tabActor -> listTab => deviceActor => screenshotToDataURL) Interesting, when requesting a screenshot via the WebIDE I seem to get the "missing part" of the screenshot, but somehow top 5-10px are missing. This is most likely because I don't handle longstr response correctly.
Flags: needinfo?(kenneth)
Yes. It seems to be me not handing the return value correctly. (https://dxr.mozilla.org/mozilla-central/source/browser/devtools/webide/modules/runtime-list.js#73) Thanks for confirming that it works.
Okay, so it's working correctly for your case now?
Flags: needinfo?(kenneth)
Well(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #5) > Okay, so it's working correctly for your case now? Well. Need to figure out how to handle the longstring return type first in order to confirm, but just close it for now. Sorry for the false alarm.
Flags: needinfo?(kenneth)
Okay, feel free to reopen if there are more issues with this!
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: