Is it possible to pass a custom fetch
function to an HTML iframe?
I would like to retrieve a private HTML document from a Pod and render it in an iframe. Retrieving the documents with the Solid API and putting it in an iframe is not the problem. But, the HTML could contain all kind of links, images, stylesheets that reference other private content on the Solid server. It seems a hassle to parse the whole HTML, trying to find all those references and replace them with javascript into authenticated versions (is there a tool that can do that easily?).
My naive idea was to provide the iframe with the custom Solid fetch
function and it will use that one to retrieve more content.
This didn’t work:
document.getElementById('myFrame').contentWindow.fetch = mySolidAuthFetch;
Are there other javascript solutions/projects that provide a “browser-in-a-browser” experience with a custom fetch api? I tried MashLib but also there I could view all the individual private files that make up a HTML page, but not a rendering of the private HTML page (plus all private resources) itself.
This is a bit related to How to add inline content in an authenticated Solid App?