fix: prevent user from zooming in the whole application (#534)

Turns out the user can zoom-in the whole application, which we didn't
notice before.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-06-27 14:20:41 -04:00 committed by GitHub
parent c6ef5edda3
commit 49d89b4ace

View File

@ -74,6 +74,16 @@ electron.app.on('ready', () => {
electron.globalShortcut.unregisterAll();
});
// Prevent the user from being allowed to zoom-in the application.
//
// This function should be called on the renderer process. We use
// `executeJavaScript()` rather than moving this to a file in the
// renderer process for convenience, since we have all other
// electron desktop experience fixes in this file.
//
// See https://github.com/electron/electron/issues/3609
mainWindow.webContents.executeJavaScript('require(\'electron\').webFrame.setZoomLevelLimits(1, 1);');
// Prevent external resources from being loaded (like images)
// when dropping them on the WebView.
// See https://github.com/electron/electron/issues/5919