GithubHelp home page GithubHelp logo

Comments (6)

HeilTec avatar HeilTec commented on August 18, 2024 2

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.

from electron-reload.

dorayx avatar dorayx commented on August 18, 2024

Can I help with this feature ?

from electron-reload.

yan-foto avatar yan-foto commented on August 18, 2024

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

from electron-reload.

dorayx avatar dorayx commented on August 18, 2024

@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

from electron-reload.

yan-foto avatar yan-foto commented on August 18, 2024

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

from electron-reload.

dorayx avatar dorayx commented on August 18, 2024

Yes, I've been working on it

from electron-reload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.