@@ -53,6 +53,12 @@ router.post('/hide-dev-tools', (req, res) => {
53
53
( _a = state . windows [ id ] ) === null || _a === void 0 ? void 0 : _a . webContents . closeDevTools ( ) ;
54
54
res . sendStatus ( 200 ) ;
55
55
} ) ;
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
+ } ) ;
56
62
router . post ( '/position' , ( req , res ) => {
57
63
var _a ;
58
64
const { id, x, y, animate } = req . body ;
@@ -139,7 +145,7 @@ function getWindowData(id) {
139
145
} ;
140
146
}
141
147
router . 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 ;
143
149
if ( state . windows [ id ] ) {
144
150
state . windows [ id ] . show ( ) ;
145
151
state . windows [ id ] . focus ( ) ;
@@ -247,6 +253,9 @@ router.post('/open', (req, res) => {
247
253
} ) ;
248
254
url = appendWindowIdToUrl ( url , id ) ;
249
255
window . loadURL ( url ) ;
256
+ window . webContents . on ( 'dom-ready' , ( ) => {
257
+ window . webContents . setZoomFactor ( parseFloat ( zoomFactor ) ) ;
258
+ } ) ;
250
259
window . webContents . on ( 'did-finish-load' , ( ) => {
251
260
window . show ( ) ;
252
261
} ) ;
0 commit comments