index.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Welcome to Tauri!</title>
  8. </head>
  9. <body>
  10. <h1>Welcome to Tauri!</h1>
  11. <script>
  12. window.addEventListener('DOMContentLoaded', (event) => {
  13. window.__TAURI__
  14. .invoke('tauri', {
  15. __tauriModule: 'Fs',
  16. message: {
  17. cmd: 'readBinaryFile',
  18. path: '.tauri_3mb.json',
  19. options: {
  20. // home folder
  21. dir: 11
  22. }
  23. }
  24. })
  25. .then((_data) => {
  26. window.__TAURI__.invoke('tauri', {
  27. __tauriModule: 'Process',
  28. message: {
  29. cmd: 'exit',
  30. exitCode: 0
  31. }
  32. })
  33. })
  34. .catch((_error) => {
  35. // error
  36. window.__TAURI__.invoke('tauri', {
  37. __tauriModule: 'Process',
  38. message: {
  39. cmd: 'exit',
  40. exitCode: 1
  41. }
  42. })
  43. })
  44. })
  45. </script>
  46. </body>
  47. </html>