S
S
Sergey2019-09-20 01:47:14
JavaScript
Sergey, 2019-09-20 01:47:14

How to save an image using JS in a VK application (WebView)?

Hello! I searched a lot on the Internet for solutions to save blob or url (URL.createObjectURL (blob)) images to the device, the result is always the same in the PC version, it works in the Anroid VK application. Just no reaction.
Who can met or knows how to solve the problem, tell me, please!
Tried the following methods:

  1. Create a link, assign href = img.src, and download = filename, then just simulate a click link.click () (in the PC, a dialog opens to save everything is OK, in Android it is completely ignored)
  2. I tried to convert to base64 through FileReader from blob and do it as in method 1, only base64 was already in href
  3. And the last window.win = open(img.src) and then win.document.execCommand("SaveAs"), again, a new window with a blob was opened in the PC, and m.vk was simply opened in the VK application.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question