If "copy image" is used in javascript-Chrome, is it possible to pass the image to the backend in another window?

Source: Internet
Author: User
Right-click a webpage image in any Chrome Window and click "copy image". When the image is added to the clipboard, is it possible to obtain the image in another Chrome Window, and pass bytes to the backend script (php, java ...)? Do I want to use flash for implementation? Right-click the webpage image in any Chrome Window and click "copy image". The image is added to the clipboard.

In this case, is it possible to obtain the graph in another Chrome Window and pass bytes to the backend script (php, java ...)?

Do I want to use flash for implementation?

Reply content:

Right-click the webpage image in any Chrome Window and click "copy image". The image is added to the clipboard.

In this case, is it possible to obtain the graph in another Chrome Window and pass bytes to the backend script (php, java ...)?

Do I want to use flash for implementation?

Theoretically it seems okay?
XHR reads the image into ArrayBuffer
Then use localStorage to store
Then you can upload the image.
The last part of this article illustrates the usage
Http://www.w3ctech.com/p/1061
Good luck ~

Add a simpler example
Https://gist.github.com/robnyman/1875241

To directly access the clipboard, you may need to use Chrome extension. Otherwise, this operation is too dangerous. There are some cut-and-paste APIs in the extension, but they are not detailed about whether binary data is supported or not.

Can the landlord elaborate on the working environment of your application.

It is estimated that it is impossible. After all, Chrome attaches great importance to security. It is impossible to allow (not extended) JavaScript in a webpage to read the clipboard.

Lz can look at this html2canvas
After encoding, the content is sent to the backend and the backend generates an image.
If there is a compatibility problem, ie9 or lower is invalid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.