Skip to content

Commit f62b47e

Browse files
committed
add documentation explaining what's going on with the zoomfactor broadcast
1 parent b99bde9 commit f62b47e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

emain/emain-util.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ const MinZoomLevel = 0.4;
1212
const MaxZoomLevel = 2.6;
1313
const ZoomDelta = 0.2;
1414

15+
// Note: Chromium automatically syncs zoom factor across all WebContents
16+
// sharing the same origin/session, so we only need to notify renderers
17+
// to update their CSS/state — not call setZoomFactor on each one.
18+
// We broadcast to all WebContents (including devtools, webviews, etc.) but
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.
1521
function broadcastZoomFactorChanged(newZoomFactor: number): void {
1622
for (const wc of electron.webContents.getAllWebContents()) {
1723
if (wc.isDestroyed()) {

0 commit comments

Comments
 (0)