refactor: replace a few usages of V8 hidden properties (#29400)
This commit is contained in:
parent
bb6903543c
commit
8d0ed05c99
5 changed files with 20 additions and 17 deletions
|
@ -1,12 +1,16 @@
|
|||
import { app, Menu } from 'electron/main';
|
||||
import { shell } from 'electron/common';
|
||||
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
|
||||
let applicationMenuWasSet = false;
|
||||
|
||||
export const setApplicationMenuWasSet = () => {
|
||||
applicationMenuWasSet = true;
|
||||
};
|
||||
|
||||
export const setDefaultApplicationMenu = () => {
|
||||
if (v8Util.getHiddenValue<boolean>(global, 'applicationMenuSet')) return;
|
||||
if (applicationMenuWasSet) return;
|
||||
|
||||
const helpMenu: Electron.MenuItemConstructorOptions = {
|
||||
role: 'help',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue