diff --git a/packages/core/src/browser/browser.ts b/packages/core/src/browser/browser.ts index eace2b5f2670d..c39a76057af7b 100644 --- a/packages/core/src/browser/browser.ts +++ b/packages/core/src/browser/browser.ts @@ -18,6 +18,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { environment } from '../common'; + const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : ''; export const isIE = (userAgent.indexOf('Trident') >= 0); @@ -31,7 +33,10 @@ export const isChrome = (userAgent.indexOf('Chrome') >= 0); export const isSafari = (userAgent.indexOf('Chrome') === -1) && (userAgent.indexOf('Safari') >= 0); export const isIPad = (userAgent.indexOf('iPad') >= 0); // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const isNative = typeof (window as any).process !== 'undefined'; +/** + * @deprecated us Environment.electron.is + */ +export const isNative = environment.electron.is(); // eslint-disable-next-line @typescript-eslint/no-explicit-any export const isBasicWasmSupported = typeof (window as any).WebAssembly !== 'undefined'; diff --git a/packages/core/src/browser/common-frontend-contribution.ts b/packages/core/src/browser/common-frontend-contribution.ts index dc1532e3315a4..99376fa1467a5 100644 --- a/packages/core/src/browser/common-frontend-contribution.ts +++ b/packages/core/src/browser/common-frontend-contribution.ts @@ -351,12 +351,12 @@ export namespace CommonCommands { }); } -export const supportCut = browser.isNative || document.queryCommandSupported('cut'); -export const supportCopy = browser.isNative || document.queryCommandSupported('copy'); +export const supportCut = environment.electron.is() || document.queryCommandSupported('cut'); +export const supportCopy = environment.electron.is() || document.queryCommandSupported('copy'); // Chrome incorrectly returns true for document.queryCommandSupported('paste') // when the paste feature is available but the calling script has insufficient // privileges to actually perform the action -export const supportPaste = browser.isNative || (!browser.isChrome && document.queryCommandSupported('paste')); +export const supportPaste = environment.electron.is() || (!browser.isChrome && document.queryCommandSupported('paste')); export const RECENT_COMMANDS_STORAGE_KEY = 'commands';