@@ -53,6 +53,12 @@ router.post('/hide-dev-tools', (req, res) => {
5353 ( _a = state . windows [ id ] ) === null || _a === void 0 ? void 0 : _a . webContents . closeDevTools ( ) ;
5454 res . sendStatus ( 200 ) ;
5555} ) ;
56+ router . post ( '/set-zoom-factor' , ( req , res ) => {
57+ var _a ;
58+ const { id, zoomFactor } = req . body ;
59+ ( _a = state . windows [ id ] ) === null || _a === void 0 ? void 0 : _a . webContents . setZoomFactor ( parseFloat ( zoomFactor ) ) ;
60+ res . sendStatus ( 200 ) ;
61+ } ) ;
5662router . post ( '/position' , ( req , res ) => {
5763 var _a ;
5864 const { id, x, y, animate } = req . body ;
@@ -139,7 +145,7 @@ function getWindowData(id) {
139145 } ;
140146}
141147router . post ( '/open' , ( req , res ) => {
142- let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, skipTaskbar, hiddenInMissionControl, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, trafficLightPosition, vibrancy, backgroundColor, transparency, showDevTools, fullscreen, fullscreenable, kiosk, autoHideMenuBar, webPreferences, } = req . body ;
148+ let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, skipTaskbar, hiddenInMissionControl, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, trafficLightPosition, vibrancy, backgroundColor, transparency, showDevTools, fullscreen, fullscreenable, kiosk, autoHideMenuBar, webPreferences, zoomFactor , } = req . body ;
143149 if ( state . windows [ id ] ) {
144150 state . windows [ id ] . show ( ) ;
145151 state . windows [ id ] . focus ( ) ;
@@ -247,6 +253,9 @@ router.post('/open', (req, res) => {
247253 } ) ;
248254 url = appendWindowIdToUrl ( url , id ) ;
249255 window . loadURL ( url ) ;
256+ window . webContents . on ( 'dom-ready' , ( ) => {
257+ window . webContents . setZoomFactor ( parseFloat ( zoomFactor ) ) ;
258+ } ) ;
250259 window . webContents . on ( 'did-finish-load' , ( ) => {
251260 window . show ( ) ;
252261 } ) ;
0 commit comments