Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we keep track of changed resources and reload only respective browser windows? #4

Open
yan-foto opened this issue Aug 29, 2015 · 6 comments

Comments

@yan-foto
Copy link
Owner

No description provided.

@dorayx
Copy link

dorayx commented Nov 8, 2015

Can I help with this feature ?

@yan-foto
Copy link
Owner Author

@dorayx sorry for the late reply! Do you have any suggestions on where to start?

@dorayx
Copy link

dorayx commented Nov 12, 2015

@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

@yan-foto
Copy link
Owner Author

This sounds promising. I haven't got into the details though! Would you create a pull request please 👍 ?

@dorayx
Copy link

dorayx commented Nov 13, 2015

Yes, I've been working on it

@HeilTec
Copy link
Contributor

HeilTec commented Nov 10, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants