Hooking into webview's loading


#1

Is there a way to hook into webview’s loading? That is, say webview’s src is set to http://example.com/a/b/c and that this URL represents a HTML page (/a/b/c/index.html) that links to a CSS stylesheet (/a/b/c/main.css), a JS script (/a/b/c/app.js) and an image (/a/b/c/logo.png).

Webview component would thus issue 4 requests for each of the mentioned resources. I’d like to be able to intercept these calls and provide the content (including headers, if required) from memory; think virtual file system.

Skimming through https://electron.atom.io/docs/api/webview-tag/ and https://electron.atom.io/docs/api/web-request/ I could not find something that could work.