Discussions » Creation Requests

Is it possible to take a given image on a webpage, and convert it to a base64 code from the image loaded on the browser without sending another request

§
Posted: 23-09-2024
Edited: 23-09-2024

I was wondering if this is possible, as some sites detect hotlinking, wordpress sites/tumblr loads an alternative content such as an HTML wrapper (will load an HTML file with the image instead of just the image when you refresh, and both the HTML and image on the same URL), and others simply 403s like what pixiv does. Firefox, when you have the devtools open, you can rightclick the img tag -> Copy -> "Image Data-URL" and you copied the image itself, just encoded into URI (a similar thing can be done in chrome using the network tab: Network tab -> refresh the page -> find the item that is an image -> Preview -> Rightclick it -> "Copy image as data URI").

I was thinking of a userscript can get the image data (that is the "data:image/png;base64" format) that is already loaded on the browser instead of sending a (additional) request (as if you visit the image URL directly; triggering the hotlink measure in the process).

Post reply

Sign in to post a reply.