My app is using electron v. 27.3.11. I would like to up-version it to a more recent electron version.
My problem is that ipcRenderer.sendTo is deprecated in 27.3.11, but absent in more recent versions.
What is the mechanism that I can use when the app creates a new Window in a renderer process, and needs to send that Window a message after it's created?
const addToPlaylistButton = document.querySelector('#add-to-playlist');
addToPlaylistButton.addEventListener(StringLiterals.CLICK, async () => {
const selectedTracks = tracksTable.searchData('selected', '=', true);
// create the new window (via new remote.BrowserWindow...)
const playlistWindow = WindowUtils.createWindow('playlist', true);
remote.require("@electron/remote/main").enable(playlistWindow.webContents);
playlistWindow.webContents.once(StringLiterals.DID_FINISH_LOAD, () => {
ipcRenderer.sendTo(playlistWindow.id, StringLiterals.CHILD_WINDOW_CHANNEL, {
'playlists': Object.keys(metadata.playlists),
'tracks': selectedTracks,
'defaultPlaylistName': getSelectedHierarchyRowData() !== undefined ?
getSelectedHierarchyRowData().displayName : StringLiterals.EMPTY_STRING,
metadata
});
});
});
Thanks in advance!