(newZoomFactor: number)
| 19 | // that is safe because "zoom-factor-change" is a custom app-defined event |
| 20 | // that only our renderers listen to; unrecognized IPC messages are ignored. |
| 21 | function broadcastZoomFactorChanged(newZoomFactor: number): void { |
| 22 | for (const wc of electron.webContents.getAllWebContents()) { |
| 23 | if (wc.isDestroyed()) { |
| 24 | continue; |
| 25 | } |
| 26 | wc.send("zoom-factor-change", newZoomFactor); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | export function increaseZoomLevel(webContents: electron.WebContents): void { |
| 31 | const newZoom = Math.min(MaxZoomLevel, webContents.getZoomFactor() + ZoomDelta); |
no outgoing calls
no test coverage detected