Skip to content

Conversation

@hitarth-gg
Copy link
Collaborator

This PR:

  • Removes the need to manually call monitorRenderer in preload files of an Electron app. Devtron now injects a preload script using ses.registerPreloadScript to track IPC events received by ipcRenderer.
  • Allows Devtron to work correctly when sandbox: true is set in webPreferences.
  • Updates the installation instructions in README.md.

@hitarth-gg hitarth-gg marked this pull request as ready for review July 19, 2025 09:34
README.md Outdated
devtron.install(); // call this function at the top of your file
```

or call `devtron.install()` inside the `app.whenReady()` callback like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, is there a reason why a consumer would prefer to call devtron.install() inside of app.whenReady()? Is there any functional difference between doing that and calling devtron.install() at the top of the file?

Copy link
Collaborator Author

@hitarth-gg hitarth-gg Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no difference between the two, but it's probably better to call devtron.install() at the top of the file.
Should I remove the readme section about installing devtron inside app.whenReady() ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, if there's no functional difference it's probably better to have only one section so it's more clear for users.

One advantage to installing it inside of app.whenReady() is that you can more easily dynamically import the module (which requires an await) if and only if your app isn't packaged, since most developers aren't going to want to ship with this package in production.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it here - 92834ce

@hitarth-gg hitarth-gg requested a review from yangannyx July 23, 2025 16:32
@dsanders11 dsanders11 merged commit 68b425f into next Jul 23, 2025
hitarth-gg added a commit that referenced this pull request Jul 31, 2025
* feat: remove need to manually call `monitorRenderer`

* docs: update install instructions

* docs: correct devtron import to use `@electron/devtron`

* docs: remove `app.whenReady()` install example from README
@dsanders11 dsanders11 deleted the feat/renderer-tracker-preload branch August 7, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants