#Problem with communicating with the function to be performed

12 messages · Page 1 of 1 (latest)

oblique spindle
#

Good evening, I have a problem. I’m trying to develop my app, but I can’t get the renderer.js file to communicate with the main.js file where there is the code to run after clicking the button. The main problems I encountered is the following, after clicking the button "ReferenceError: require is not defined
at HTMLButtonElement.<anonymous> (renderer.js:3:27)
(anonymous) @ renderer.js:3".
If anyone can help me out on the fly, I’d be very grateful.

code: https://pastebin.com/YRADNTg7

jovial tapir
tight juniper
#

I'm glad I didn't write this thing for nothing

jovial tapir
#

best thing ever

#

❤️

tight juniper
#

awww x)

oblique spindle
#

thank you very much!

oblique spindle
#

Sorry for the ignorance, I read both links both the explanation on github and the link that advised to read. I learned a couple more information and better understood communication. But I can’t understand how using the "contextBridge" method I can get to "ipcMain" which is in the main.js file, let me explain. Does the function "ipcMain" in the main.js file remain unchanged after the change in the renderer.js? or should I also use "contextBridge" there? Thanks in advance

jovial tapir
#

contextBridge is preload specific feature

#

you cant use it main

#

and you dont need it

#

in main