Binds a paste event handler. This also prevents Ctrl+C/Cmd+C/Shift+Insert presses from going to the game.
handler_script can be a script/function taking the following arguments:
data: for pasted text this is the text itself while for other formats it'll be base64 string such as
name: name of the file pasted.
If the name is unknown, this is
For pasted text, this is
(comparing it to
undefinedis how you figure out whether to decode base64)
type: MIME type of whatever that you've got here.
filter_script can be a script/function taking the following arguments:
"string"for text or
type: MIME type of the item.
it can then return
false based on whether you want to have it passed on to the
Discarding unsupported files early can spare the page from loading files that you weren't going to process anyway.
If the handler is omitted (
browser_paste_bind()), unbinds the handler.