0
我需要从devtools中触发此事件。它从使用mainWindow.webContents.send('get-holdings', 'get holdings!');
触发电子BrowserWindow中devtools的ipcRenderer事件
主要过程(js
)呼吁时,我有webPrefences
镶有nodeIntegration: false
如果nodeIntegration
设置为true
因为有jquery
和angular
错误触发。
对于调试,我想从devtools控制台执行它。我正在寻找需要放入devtools控制台的代码来触发get-holdings
事件。
ipcRenderer.on('get-holdings', (event, arg) => {
var holdings;
$.getJSON('https://example.com/api/holdings', function(res){
holdings = res.data;
console.log(holdings);
ipcRenderer.send('save-holdings', holdings);
});
console.log(arg);
})
请帮忙!