diff --git a/.gitignore b/.gitignore
index 190247aac..c7dd43b96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,3 +86,6 @@ Cargo.lock
# doing this because the task-runner (`mask prepare`) will clone gh:tauri-apps/examples
/examples
+
+# ignore frida handlers
+__handlers__/
diff --git a/tauri/examples/communication/dist/dialog.js b/tauri/examples/communication/dist/dialog.js
index 450150b94..73d17291e 100644
--- a/tauri/examples/communication/dist/dialog.js
+++ b/tauri/examples/communication/dist/dialog.js
@@ -9,7 +9,25 @@ document.getElementById('open-dialog').addEventListener('click', function () {
filter: filterInput.value || null,
multiple: multipleInput.checked,
directory: directoryInput.checked
- }).then(registerResponse).catch(registerResponse)
+ }).then(function (res) {
+ console.log(res)
+ var pathToRead = res
+ var isFile = pathToRead.match(/\S+\.\S+$/g)
+ window.tauri.readBinaryFile(pathToRead).then(function (response) {
+ if (isFile) {
+ if (pathToRead.includes('.png') || pathToRead.includes('.jpg')) {
+ arrayBufferToBase64(new Uint8Array(response), function (base64) {
+ var src = 'data:image/png;base64,' + base64
+ registerResponse('')
+ })
+ } else {
+ registerResponse(res)
+ }
+ } else {
+ registerResponse(res)
+ }
+ }).catch(registerResponse(res))
+ }).catch(registerResponse)
})
document.getElementById('save-dialog').addEventListener('click', function () {
diff --git a/tauri/examples/communication/dist/index.html b/tauri/examples/communication/dist/index.html
index eb3e5f33a..80117c605 100644
--- a/tauri/examples/communication/dist/index.html
+++ b/tauri/examples/communication/dist/index.html
@@ -2,90 +2,241 @@