I want to be able to save / archive HTML pages as one file (without those pesky external folders).
I want the resulting file to contain all styles, images, and links (vid
Usually, it's possible to create one HTML file that contains all his common children files (css, jpg, js, svg, ...)
You must rewrite the HTML file by replacing "src
" attributes' value, "url()
" functions and insert HTML tag like "" for JavaScript files, "
" for CSS files and "
" for SVG image.
For example a GIF image file in CSS called by the "url()
" function.
url('https://en.wikipedia.org/wiki/File:TPB_Magnet_Icon.gif')
" by "url('data:image/gif;base64,R0lGODlhDAAMALMPAOXl5ewvErW1tebm5oocDkVFRePj47a2ts0WAOTk5MwVAIkcDesuEs0VAEZGRv///yH5BAEAAA8ALAAAAAAMAAwAAARB8MnnqpuzroZYzQvSNMroUeFIjornbK1mVkRzUgQSyPfbFi/dBRdzCAyJoTFhcBQOiYHyAABUDsiCxAFNWj6UbwQAOw')
" with the Base64 encoded GIF image, prefixed by "data:image/gif;base64,
"You can do the same thing for the "src
" attribute's value.
This solution may be used for other binary files. You must adapt the right "data
" prefix to corresponding to the encoded object.