Today we’ve implemented perhaps most wanted idea since 2008 – we now allow placing images right inside issue description text (assuming it is edited in HTML format).
You can either drag file from your local disk and drop it into the text, you can copy the file from your local disk and paste it into the text or you can take a screenshot or copy a selection from image processing program and paste it into the text – the operations supported are determined by the APIs provided by your browser. Below is the summary table for supported browsers and operations, each cell specifies minimal required browser version.
drop file | paste image | paste file | |
Internet Explorer | 10 | 11 | - |
Chrome | 13 | 13 | - |
Firefox | 4 | 4 | 22 |
Safari | 6 | 6 | - |
Opera | 15 | 15 | - |
Why it took so long? The answer is security.
There were times web page could run locally installed applications such as calculator and access local files. Yet it quickly turned out that the web is a dangerous place and browser vendors applied many restrictions to reduce web page abilities. Web developers found work around these restrictions with use of Java applets and Flash, yet since such a behavior still pose a security threat, components’ abilities were restricted as well. At the time the idea was posted there were no way to access image data place in the clipboard without elevating browser’s privileges.
Yet, now web moves toward rich applications and browser vendors added some APIs that allowed us finally to address this idea.
Idea’s implementation requires the browser to support couple of web standards: Drag And Drop and/or Clipboard API to have an access to the image, File API to read its content and convert it to Data URI - to display the image without sending it to the server; standards that were implemented by browser vendors in 2012-2013.
Support for Data URI and File API is absolutely required – without them we can not access the image data. Support for Drag and Drop or Clipboard API determines the way you can place image inside of the text – at least support for one is required.
Above the editor we are displaying a box that lists operations available. Yet we would like to note that we test for available APIs, not for browser/version and thus detection can produce “false positives” – for example, IE10 claims to support pasting images; Chrome as of v31 claims to support pasting files. Yet while having all necessary APIs both browsers report no clipboard content.
Comments