提交 0f5d7641 编写于 作者: B Benjamin Pasero

bootstrap - move zoom setting up

上级 0ad1c5bc
...@@ -32,6 +32,12 @@ exports.load = function (modulePaths, resultCallback, options) { ...@@ -32,6 +32,12 @@ exports.load = function (modulePaths, resultCallback, options) {
const args = parseURLQueryArgs(); const args = parseURLQueryArgs();
const configuration = JSON.parse(args['config'] || '{}') || {}; 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 // Error handler
// @ts-ignore // @ts-ignore
process.on('uncaughtException', function (error) { process.on('uncaughtException', function (error) {
...@@ -51,12 +57,6 @@ exports.load = function (modulePaths, resultCallback, options) { ...@@ -51,12 +57,6 @@ exports.load = function (modulePaths, resultCallback, options) {
// Enable ASAR support // Enable ASAR support
bootstrap.enableASARSupport(path.join(configuration.appRoot, 'node_modules')); bootstrap.enableASARSupport(path.join(configuration.appRoot, 'node_modules'));
// Apply zoom level early to avoid glitches
const zoomLevel = configuration.zoomLevel;
if (typeof zoomLevel === 'number' && zoomLevel !== 0) {
webFrame.setZoomLevel(zoomLevel);
}
if (options && typeof options.canModifyDOM === 'function') { if (options && typeof options.canModifyDOM === 'function') {
options.canModifyDOM(configuration); options.canModifyDOM(configuration);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册