window

· WEB/Electron
[Electron] 자식창(Child Window) 자식창은 부모창 위에 보여진다. 자식창을 선언 할 때, parent: 부모창를 입력하여 부모의 자식임을 선언한다. 기본적으로 createWindow시 부모창과 자식창 모두 선언해 준다. 아래와 같이 입력하면 앱을 실행할 때 자식창과 부모창 모두 표시된다. let win; // 부모 let child; // 자식 function createWindow() { // 부모 창 선언 win = new BrowserWindow({ width: 1400, height: 1000, webPreferences: { nodeIntegration: true } }); // 자식 창 선언 child = new BrowserWindow({ parent: win, width:..
· WEB/Electron
[Electron] window.require is not a function 에러 예제) window.require('electron').ipcRenderer 추가하기. 1. 페이지의 다른 스크립트들이 실행되기 전 먼저 로드할 스크립트 추가. 파일명 : preload.js window.ipcRenderer = require('electron').ipcRenderer; 2. 메인 main.js (index.js) 파일에서 BrowserWindow 생성시 webPreferences 옵션 추가. new BrowserWindow({ ... webPreferences: { nodeIntegration: false, preload: __dirname + '/preload.js' } ... }); 3. 사용. wi..
S0PH1A
'window' 태그의 글 목록