There is a foreign site whose content is not under my control.
When I open this site, it contains an image.
Using DOM traversal, I can predictably store the according <img> tag into a variable.
I want that image somehow extracted, without having to intervene manually.
It is intended that other programs, running under my control on localhost, can furtherly manipulate and use the image.
I thought of creating a local web server, and letting the JS send me "some data" via post to that web server.
However, simply reloading from src is NOT possible, since the content changes dynamically (non-idempotent behaviour of the foreign server in response to a get request), and I badly want exactly the same image as displayed in the browser.
According to w3schools
, the <img> tag is just a container.
That leaves me with the question: How can I access the image itself (programatically) without reloading it from src?
Google hasn't turned up a result, I'm new to JS, and nobody I know can give me a hint.
Just to make my point clear: I'm only talking about that image-extraction part.
Everything else can be adapted to this (except the foreign server, of course)
(Posted under DOM because I thought the solution might somehow DOM-related. Not sure though.)