Reputation: 13678
Let's say I have a website that I want to turn into a desktop application using either an iframe or webview within an Electron app. Let's also assume that this website has a lot of images on it that I would like to cache in the Electron app so that they only have to download those images once.
Is there a way to access those local files (that are bundled in the Electron app) from the remote site that has been loaded in the iframe/webview?
Upvotes: 1
Views: 1654
Reputation: 13678
Unfortunately, there wasn't a very straightforward way to make this work. However, we managed to get a slightly hacky system setup that seems to do the job:
postMessage
or ipc
.Upvotes: 2
Reputation: 847
by default electron cache most of the http requests , check this to understand how it works https://github.com/electron/electron/blob/master/docs/api/web-contents.md#contentsloadurlurl-options
Something interesting https://medium.com/@philipp.schaechtele/asset-caching-with-service-worker-c40dcda43842
Hope it helps
Upvotes: 0