Reputation: 2338
I need to be able to detect the paste event. It is centered around images for the most part, but as of now I will accept anything that will detect the event.
I have successfully had 99% of all posted solutions work for Chrome, but that is it. Even the ones that are stating they work for IE, Firefox and more they do not.
If someone can just point me in a direction that they have successfully used to just detect the paste event and have either a console log or alert occur that would be excellent.
I'm not sure if this will make sense, but an on DOCUMENT paste would be ideal as I would not like to specify the paste area.
EDIT: The research that I have done for this has been finding a multitude of options that use .bind() and .on() in conjunction with 'paste'. However, paste event does not seem to fire in IE or Firefox. They work in Chrome, but it is unclear to me on why this is the case.
Upvotes: 3
Views: 3973
Reputation: 5691
You can use the Clipboard API.
and then use .getAsFile()
as described here: https://stackoverflow.com/a/6338207/1052033
Upvotes: 3