mirror of
https://github.com/electron/electron.git
synced 2026-10-28 11:44:46 +08:00
* perf: find and apply the app's package.json natively before the main-process JS runs
lib/browser/init.ts located the app by pushing each of resources/app.asar,
app and default_app.asar through Module._load('<dir>/package.json') inside
a try/catch (a full CommonJS resolve, an fs.existsSync-style archive probe
and a thrown MODULE_NOT_FOUND per miss), then set the name, version, Linux
desktop name (desktop-name.ts, NFKD + two regex passes) and v8Flags one
app.* call at a time, stat'ed for Squirrel's Update.exe on Windows, and
registered a will-finish-launching listener that built the default menu
from default-menu.ts. base-window.ts gave every new window the application
menu from a JS _init hook.
ElectronBrowserMainParts now does the lookup with one asar-aware read per
candidate and applies the manifest to Browser directly (app_package.cc),
leaving init.ts only {path, main, esm} to load the entry script from. The
default File/Edit/View/Window menu is installed by Menu before
will-finish-launching is emitted unless the app already called
Menu.setApplicationMenu, and BaseWindow picks up the application menu when
it is wrapped. desktop-name.ts and default-menu.ts are deleted; the
desktop-name spec runs against the native implementation.
* fix: keep the app menu ahead of browser-window-created, tolerate non-UTF-8 package.json, register Menu templates before the default menu is built
* fix: apply package.json v8Flags just before the entry script so the startup bundles keep their code cache