-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preventing image paste on editor #132
Comments
You can define special rules for clearing pasted content before pasting it You will have to pass these special paste rules on editor init to make it work Rule without condition is executed as default In your case this should work
|
I can't get image pasting working at all. I'm using firefox on a mac. Is there something I can change to make it work? |
@mschering Are you copying images from a word processor or some other desktop program. wysihtml does not work with copying images from word(or it did not used to work). I had to make some changes to make it accept copied images from word. |
I found out that that the editor prevents the default paste event. I made a small change to make it work. I created a new issue for it here: |
I want to disallow image pasting inside the editor(because i am using base64 of images in some other way). So here is my editor
Now i listened to all 3 events
paste
,paste:composer
andpaste:textarea
. On these 3 events i check ifthe item is a file using
event.clipboardData.items[event.clipboardData.items.length-1].kind == 'file'
and if true i tried all of these.Ideally
return false
should be enough for preventing the action and stopping the propagation but anyway. But still the image is pasted. What else do i need to do to prevent the image from being pasted?The text was updated successfully, but these errors were encountered: