未验证 提交 836fbb1b 编写于 作者: R Robo 提交者: GitHub

fix: preserve zoom level on navigation (#104268)

上级 4d7ee022
......@@ -23,6 +23,7 @@
}(this, function () {
const preloadGlobals = globals();
const sandbox = preloadGlobals.context.sandbox;
const webFrame = preloadGlobals.webFrame;
const safeProcess = sandbox ? preloadGlobals.process : process;
/**
......@@ -35,6 +36,7 @@
/**
* // configuration: INativeWindowConfiguration
* @type {{
* zoomLevel?: number,
* extensionDevelopmentPath?: string[],
* extensionTestsPath?: string,
* userEnv?: { [key: string]: string | undefined },
......@@ -43,6 +45,12 @@
* }} */
const configuration = JSON.parse(args['config'] || '{}') || {};
// Apply zoom level early to avoid glitches
const zoomLevel = configuration.zoomLevel;
if (typeof zoomLevel === 'number' && zoomLevel !== 0) {
webFrame.setZoomLevel(zoomLevel);
}
// Error handler
safeProcess.on('uncaughtException', function (error) {
onUnexpectedError(error, enableDeveloperTools);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册