I'm newbie. I have some problem!
As a title, help me pls. I got this bug Even if I set enableremotemodule = true. This is my code
javascript:
const $ = require('jquery');
const remote_v = require("electron").remote;
var win = remote.getCurrentWindow();
$('#minimize').click(function(){
remote_v.BrowserWindow.getFocusedWindow().minimize();
});
$('#close').click(function(){
remote_v.getCurrentWindow().close();
});
main.js
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 530,
height: 330,
resizable: false,
frame : false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
preload: path.join(__dirname, 'preload.js')
}
})
mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools();
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
Thank you very much, have a nice day!.