Relative Content

Tag Archive for javascriptelectron

ipcmain.handle parameter has metadata(?) instead of value

I am a beginner to electron and my app does nothing more than unpack a zip and start a .bat file (it’s an installer) i need the user to give a url to a database but when it returns i get in ipcMain: {"sender":{"_windowOpenHandler":null,"ipc":{"_events":{},"_eventsCount":1,"_invokeHandlers":{}},"_events":{"render-process-gone":[null,null]},"_eventsCount":13},"frameId":1,"processId":4}

Get currently played media cover with Javascript/electronjs

for a project I’m doing right now I wanted to know something about media in windows. Some apps are able to fetch the cover of the media you are currently platying on your computer (from whatever plateform) and I wanted to know how can this be acheived using javascript and electronjs. If someone can give me a hint or a full answer It would be insane.
I’m putting below a picture of what I’m talking about.

I am practice ipcRenderer but I can not see the result which i think would happen

I am a student and actually English is not my native language so there must be lots of grammer problem I’m so sorry.And just like what I wrote on title I’m learning how to use ipcRenderer but it didn’t work.I mean when I press the button the application doesn’t quit.And I have try just console.log(), when I press button.It of course can work.However,After I addrequire("electron").ipcRenderer.send('close').Not only when i press button the application do not quit, but also it don’t cout any thing.

Data sent from Electron’s main to render is an empty object

So, I’m trying to send data from my main.js, to be used in the renderer to draw divs to my html, after not being able to use the content from my JSON I decided to try and send a simple string, and the problem persists, a useless object.(Tried stringify, tried “toString()” and it only becomes an “Object”.
Funnily enough, sending data from render to main works perfectly, I’m receiving it and storing it into a file that works just fine.