Convert already loaded image to base64

Viewed 68

I have a use case to convert images to base64 using the url. But the website loads the image only once. I cannot convert to canvas since it requires a network call and is forbidden for second time. But I am able to achieve the conversion using the sources panel in chrome which has an option to convert already loaded images to data URI. Ex: https://developers.google.com/web/updates/2015/05/copy-image-as-data-uri

I would like to do this programatically using javascript. Either I inject a module while the image loads to convert to base64 and store it or access the sources panel in chrome to convert to data URI as it does.

I would like to know if there are any extensions to achieve this.

Thank you

0 Answers
Related