Open yan-foto opened 9 years ago
@dorayx sorry for the late reply! Do you have any suggestions on where to start?
@yan-foto I think these events might help:
did-finish-load
did-get-response-details
will-navigate
We can get the URLs of the loaded files by the event did-finish-load
,
but some other files may be loaded by a request, such as the scripts and the stylesheets
I think we can fetch the URLs of those by the event did-get-response-details
Then we create a Map
object to maintain every loaded resource,
an URL as the key and an array of the relative webContents
objects as the value
So every time a resource is changed, we will get the resource URL via the module chokidar
and then reloadIgnoringCache
the webContents
objects associated with it
This sounds promising. I haven't got into the details though! Would you create a pull request please :+1: ?
Yes, I've been working on it
The render process can load resources in several ways.
Any references made by the loaded file (index.html) like script tags or external style-sheets can be leached from the webContents
events.
To detect modules loading using require('module')
a global hook needs to be implemented.
Hooking the require
function in the main module does not seem to affect sub-modules loading.
@dorayx Have you made any uncommitted progress?
Despite the problems, I feel this warrants looking into.
Can I help with this feature ?