# Browser\_io. An extension for HTML5 copying ,pasting, saving, opening and drag and drop

**URL:** <https://forum.defold.com/t/browser-io-an-extension-for-html5-copying-pasting-saving-opening-and-drag-and-drop/83340>\
**Category:** The Defoldmine\
**Created:** [October 10, 2026, 9:07am UTC](https://forum.defold.com/t/browser-io-an-extension-for-html5-copying-pasting-saving-opening-and-drag-and-drop/83340 "2026-10-10T09:07:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Fowler](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/andrew_fowler/32/43431_2.png) [@Andrew\_Fowler](https://forum.defold.com/u/Andrew_Fowler)\
**Post date:** [October 10, 2026, 9:07am UTC](https://forum.defold.com/t/browser-io-an-extension-for-html5-copying-pasting-saving-opening-and-drag-and-drop/83340/1 "2026-10-10T09:07:37Z")

</div>

I’ve been using the clipboard extension in Defold, but didn’t realize it doesn’t work on HTML5 builds.

My initial attempt was a bit messy, involving Lua modules and modifications to the index.html file. So I went back to the drawing board and created my own extension. Hopefully, it will be useful to others as well.

[https://github.com/alfowler1976/defold\_browser\_io](https://github.com/alfowler1976/defold_browser_io)

It provides asynchronous, callback-based functionality with the following commands:

- `browser_io.copy()` — copy text to the clipboard

- `browser_io.paste()` — read text from the clipboard

- `browser_io.open_file()` — open a browser file picker and read a file

- `browser_io.save_file()` — download/save data as a file

- `browser_io.set_drop_listener()` — receive files dropped onto the browser window

- `browser_io.cancel_drop_listener()` — remove the active drop listener

The extension handles the JavaScript/browser interaction internally via Emscripten, so no manual `index.html` changes are required.

Typical usage is:

```lua
browser_io.open_file({ accept = ".txt" }, function(self, result)
    if result.success then
        print(result.name, result.data)
    end
end)

```

Note: Drag-and-drop events are desktop-only, and some browsers (like Firefox) enforce strict permission prompts for reading the clipboard.
