The default bug view has changed. See this FAQ.

GCLI needs a screenshot command

RESOLVED FIXED in Firefox 15

Status

()

Firefox
Developer Tools: Console
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jwalker, Assigned: vporof)

Tracking

unspecified
Firefox 15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-fx-team])

Attachments

(1 attachment, 2 obsolete attachments)

i.e.

  > screenshot foo.png
  Saved screenshot of current page to 'downloads/foo.png'
This needs to take into account bug 664693 comment 10 (and the few comments prior to that).

Comment 2

5 years ago
Would it be possible to also add support for:

* screenshots copied directly to clipboard, rather than saved on disk;
* screenshots of the viewport/entire window; and
* screenshots of a particular area/element.

The last one could encapsulate the second (screenshot --elem body). I'm not sure of the syntax for it, though. Perhaps "screenshot --elem <selector>".
Blocks: 711051
No longer blocks: 659052
Bug triage, filter on PEGASUS.
Target Milestone: --- → Firefox 12
Bug triage, filter on PEGASUS.
Priority: -- → P2
No longer blocks: 711051
Created attachment 590679 [details] [diff] [review]
upload 1

Basic implementation.
No tests, l10n incomplete, errors in getting default download directory.
Assignee: nobody → jwalker
Status: NEW → ASSIGNED
Target Milestone: Firefox 12 → Firefox 13
https://tbpl.mozilla.org/?tree=Try&rev=b447debd6053
Created attachment 593142 [details] [diff] [review]
upload 2

Basically working.
Just does current window, and only to a file right now. Enhancements welcome.
Attachment #590679 - Attachment is obsolete: true
https://tbpl.mozilla.org/?tree=Try&rev=9dbf9f91493c
https://bugzilla.mozilla.org/show_bug.cgi?id=723431
Target Milestone: Firefox 13 → Firefox 14
(Assignee)

Comment 10

5 years ago
Can I take this?
(In reply to Victor Porof from comment #10)
> Can I take this?

You're welcome to
Just checked and that's the latest version.
It works OK, but can only screenshot the visible screen
(Assignee)

Comment 13

5 years ago
Cool, I'll play with it a bit.
Assignee: jwalker → vporof
GCLI Triage.
Target Milestone: Firefox 14 → Firefox 15
Blocks: 745773
No longer blocks: 745773
(Assignee)

Comment 15

5 years ago
Created attachment 626805 [details] [diff] [review]
v3

Now able to screenshot the entire webpage view bounds or just a single node identified by a css selector.
Attachment #593142 - Attachment is obsolete: true
Attachment #626805 - Flags: review?(jwalker)
Comment on attachment 626805 [details] [diff] [review]
v3

Review of attachment 626805 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: browser/devtools/commandline/GcliCommands.jsm
@@ +195,5 @@
> +
> +    let source = ioService.newURI(data, "UTF8", null);
> +    persist.saveURI(source, null, null, null, null, file);
> +
> +    return "Saved to " + filename;

We're planning on adding a green tick-mark to indicate that the command executed correctly, and I'm expecting that the user will know the filename, so I think we can just return here.

In the future, I've been mulling over the idea that we should have an implicit --verbose flag for all commands which we could turn on/off globally or on a case by case basis.
Attachment #626805 - Flags: review?(jwalker) → review+
(Assignee)

Comment 17

5 years ago
(In reply to Joe Walker from comment #16)
> Comment on attachment 626805 [details] [diff] [review]
> v3
> 
> Review of attachment 626805 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Thanks!
> 
> ::: browser/devtools/commandline/GcliCommands.jsm
> @@ +195,5 @@
> > +
> > +    let source = ioService.newURI(data, "UTF8", null);
> > +    persist.saveURI(source, null, null, null, null, file);
> > +
> > +    return "Saved to " + filename;
> 
> We're planning on adding a green tick-mark to indicate that the command
> executed correctly, and I'm expecting that the user will know the filename,
> so I think we can just return here.
> 

I'm not entirely sure that the user will know the filename right from the start. First time I tried a screenshot and didn't enter a fullpath, I almost got confused on whether the image will be saved in my downloads folder, or on my desktop (like os x does).

Maybe we should keep it?
(In reply to Victor Porof from comment #17)
> ...
> > We're planning on adding a green tick-mark to indicate that the command
> > executed correctly, and I'm expecting that the user will know the filename,
> > so I think we can just return here.
> > 
> 
> I'm not entirely sure that the user will know the filename right from the
> start. First time I tried a screenshot and didn't enter a fullpath, I almost
> got confused on whether the image will be saved in my downloads folder, or
> on my desktop (like os x does).
> 
> Maybe we should keep it?

Ok, you sold me.
Thanks.
https://tbpl.mozilla.org/?tree=Fx-Team&rev=a24414165cd4
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/68600a8af079
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Blocks: 768998
You need to log in before you can comment on or make changes to this bug.