Can a Base64 encoded image be loaded as a background image URL without exposing the actual encoded string in the page source?
For example, if a Node API is used to GET request at "/image"
, it returns the serialized Base64 data.
res.json("data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//Aw.....blah blah
Is it possible to display this on the frontend as a URL only? So that the background-image shows the URL ONLY and not the actual Base64 encoded text in the frontend page source.
When you right-click and choose inspect
, it will show this:
.my-image {
background-image: url("http://exampleapi.net:8080/image");
}
But it won't show this:
.my-image {
background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD.... etc.
}