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

How to show a window from a page by use ipcRenderer? #269

Closed
letruonglamit opened this issue Jul 27, 2022 · 4 comments
Closed

How to show a window from a page by use ipcRenderer? #269

letruonglamit opened this issue Jul 27, 2022 · 4 comments
Labels
question Further information is requested

Comments

@letruonglamit
Copy link

letruonglamit commented Jul 27, 2022

When I implement, I got the errors like this:
Screen Shot 2022-07-27 at 10 50 33

@Psycokwet
Copy link
Collaborator

If you comment line 29, does the error happen?
It seem to come from elsewhere

@roscoevanderboom
Copy link

@letruonglamit I tried to recreate your error using the Material UI template but it works fine for me. Make sure nodeIntergration: true,
contextIsolation: false,
and if all that fails, try
window.electron.ipcRenderer.send("sss").

@saltyshiomix saltyshiomix added the question Further information is requested label Sep 13, 2023
@bm777
Copy link
Collaborator

bm777 commented Dec 2, 2023

@letruonglamit, you should load it dynamically.

Something like this:

let ipcRenderer

if(typeof window !== "undefined" && window.process && window.process.type === "renderer"){
    ipcRenderer = window.require('electron').ipcRenderer
    console.log("DEBUG: ipcRenderer", ipcRenderer)
    ipcRenderer.send("sss")
}

@bm777
Copy link
Collaborator

bm777 commented Dec 2, 2023

Will close this issue :), feel free to reopen it if you have other issues.

@bm777 bm777 closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants