fix: preserve zoom level on navigation (#104268)
This commit is contained in:
parent
4d7ee02205
commit
836fbb1b5d
1 changed files with 8 additions and 0 deletions
8
src/bootstrap-window.js
vendored
8
src/bootstrap-window.js
vendored
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue