Showing the cursor for headless browser
This commit is contained in:
@@ -71,6 +71,8 @@ ipcMain.handle('getOptions', function () {
|
||||
* @param {Object} event
|
||||
*/
|
||||
ipcMain.handle('capturePage', async function (event, captureRect, frameIndex) {
|
||||
// To show the cursor for headless browser
|
||||
mainWindow.focusOnWebView();
|
||||
const img = await mainWindow.webContents.capturePage(captureRect);
|
||||
const outputPath = path.join(renderDir, frameIndex + '.png');
|
||||
fs.writeFileSync(outputPath, img.toPNG());
|
||||
|
||||
@@ -8,7 +8,6 @@ contextBridge.exposeInMainWorld('app', {
|
||||
return ipcRenderer.invoke('getOptions');
|
||||
},
|
||||
capturePage(captureRect, frameIndex) {
|
||||
console.log('prelaod > capturePage');
|
||||
return ipcRenderer.invoke('capturePage', captureRect, frameIndex);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user