Closed Bug 602313 Opened 9 years ago Closed Last year

Allow creation of attachments by pasting an image from clipboard, as well as by drag-and-dropping a file from desktop

Categories

(bugzilla.mozilla.org :: General, enhancement)

Production
enhancement
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: kohei)

References

Details

(Keywords: bmo-ux, ux-efficiency)

Attachments

(1 file)

45 bytes, text/x-github-pull-request
Details | Review
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 (.NET CLR 3.5.30729)
Build Identifier: 

A very common workflow in our QA department is:

1. Take screenshot by pressing PrintScreen on windows.  This places the screenshot on the clipboard.
2. Open MS Paint, paste screenshot, save as PNG.
3. On enter_bug.cgi, click "add attachment", then navigate to PNG file from #2.

This bug proposes a streamlined workflow that would save several keystrokes and mouse clicks:

1. Take screenshot via PrintScreen.
2. Click "create image attachment from clipboard contents" button on enter_bug.cgi

This feature has been discussed in bug 362337 and bug 252782 comment 20, but mostly in the context of what ended up as bug 222861.  I'm filing this bug so that the merits of this feature can be discussed separately from those bugs.

It seems there are ways of getting at least text clipboard contents without resorting to Flash or a Java applet: http://ajaxian.com/archives/accessing-the-system-clipboard-from-web-applications.

A version of this feature that only works in FF would be just fine in my organization.  A version that required Flash or Java would be fine as well.

Reproducible: Always
Duplicate of this bug: 723474
See request bug 723474.

(In reply to Matt McHenry from comment #0)

> Click "create image attachment from clipboard contents" button on
> enter_bug.cgi

I prefer going for an explicit pasting action by the user, for example Ctrl V.

I don't know whether there already exists a Web browser who can [feature A] read the clipboard to the page at button click or who can [feature B] accept explicit image pasting by the user. If not, it will happen quite soon.

Let's suppose we have a Web browser who can do both of these features.

Allowing the Web page to read from the clipboard would be very touchy. The clipboard belongs to the user and is OS-wide. Allowing the Web page to read from the clipboard would, *at least*, require a browser prompt asking the user "The Web page wants to read the contents of the clipboard. Do you accept ?" with no "Yes" default answer. Even at user click on a button in the page. And some browsers will probably stay without this feature altogether, for the sake of security. The same goes for some sensitive environments : in military and other paranoid places, the feature, if present, will probably be disabled / unavailable. And would feature A rely on JavaScript ? Some Web users come without JavaScript, and they are perfectly right to do so.

A contrario, feature B looks safe to me. Completely in the same vein as the HTML5 drag-and-drop stuff. The user pastes, for instance by pressing Ctrl V. The clipboard's contents get inserted. Text, or image, or even video or sound, à la QuickTime. Like in Word, in Paint, in TextEdit... Straightforward, easy, very common use case. Let's rule out for the moment the awkward windowsesque story of copying / pasting a file. ;-) 

Nicolas
This feature is implemented on JIRA using Java applets
http://confluence.atlassian.com/display/JIRA044/Attaching+a+Screenshot
Duplicate of this bug: 362337
Duplicate of this bug: 961668
A lot has changed since this bug was last commented on.  Things are probably much easier than they used to be regarding implementing this.  I'm sure JIRA does it without a Java applet now, for example (because I don't even have a working Java and it still works for me).  WordPress also does it without Flash or Java.
Implementing the functionality is apparently possible even without any plug-in, but I’m not sure if there are actual use cases. If you want to share a web page’s screenshot, Firefox Screenshots can be used very easily.

https://stackoverflow.com/questions/18377891/how-can-i-let-user-paste-image-data-from-the-clipboard-into-a-canvas-element-in
Here we go: https://github.com/kyoshino/bmo/compare/bug-602313-image-paste-upload

Needs some more UX tweaks, but it works!
Let’s do this along with basic drag & drop support.
Assignee: attach-and-request → kohei.yoshino
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: bmo-ux
I’m surprised to see no enhancement requests for the drag & drop support, which has been natively implemented in browsers for 10 years. Extending this bug to cover both input methods then.
Summary: Allow creation of image attachments directly from pasted clipboard contents, without the need to save as a file → Allow creation of attachments by pasting an image from clipboard, as well as by drag-and-dropping a file from desktop
Attached file pull request
Component: Attachments & Requests → General
Keywords: ux-efficiency
Product: Bugzilla → bugzilla.mozilla.org
QA Contact: default-qa
Version: unspecified → Production
PR already merged to master.
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Blocks: 1421032
You need to log in before you can comment on or make changes to this bug.