womesiete

doCode Library

Mar 25th, 2023 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. var imgUri = local("astext")
  2.  
  3. var html = `
  4. <html>
  5. <head>
  6. <title>Display Image</title>
  7. <style>
  8. body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: black; }
  9. img { max-width: 100%; max-height: 100%; }
  10. </style>
  11. </head>
  12. <body>
  13. <img src="` + imgUri + `" alt="Loaded Image">
  14. </body>
  15. </html>
  16. `;
  17.  
  18. // Use Tasker's HTML Dialog to display the image
  19. var intent = {
  20. action: "android.intent.action.VIEW",
  21. data: "data:text/html," + encodeURIComponent(html),
  22. type: "text/html"
  23. };
  24.  
  25. // Send intent to Tasker's Open File/URL action
  26. app.sendIntent(intent);
Advertisement
Add Comment
Please, Sign In to add comment