diff --git a/src/vs/workbench/contrib/webview/browser/overlayWebview.ts b/src/vs/workbench/contrib/webview/browser/overlayWebview.ts index 1c9088e142443..7bc380d9818da 100644 --- a/src/vs/workbench/contrib/webview/browser/overlayWebview.ts +++ b/src/vs/workbench/contrib/webview/browser/overlayWebview.ts @@ -117,7 +117,7 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { const oldOwner = this._owner; this._owner = owner; - this.show(); + this._show(); if (oldOwner !== owner) { const contextKeyService = (scopedContextKeyService || this._baseContextKeyService); @@ -184,7 +184,7 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { } } - private show() { + private _show() { if (this._isDisposed) { throw new Error('Webview overlay is disposed'); } @@ -259,25 +259,25 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { public get html(): string { return this._html; } public set html(value: string) { this._html = value; - this.withWebview(webview => webview.html = value); + this._withWebview(webview => webview.html = value); } public get initialScrollProgress(): number { return this._initialScrollProgress; } public set initialScrollProgress(value: number) { this._initialScrollProgress = value; - this.withWebview(webview => webview.initialScrollProgress = value); + this._withWebview(webview => webview.initialScrollProgress = value); } public get state(): string | undefined { return this._state; } public set state(value: string | undefined) { this._state = value; - this.withWebview(webview => webview.state = value); + this._withWebview(webview => webview.state = value); } public get extension(): WebviewExtensionDescription | undefined { return this._extension; } public set extension(value: WebviewExtensionDescription | undefined) { this._extension = value; - this.withWebview(webview => webview.extension = value); + this._withWebview(webview => webview.extension = value); } public get options(): WebviewOptions { return this._options; } @@ -286,11 +286,11 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { public get contentOptions(): WebviewContentOptions { return this._contentOptions; } public set contentOptions(value: WebviewContentOptions) { this._contentOptions = value; - this.withWebview(webview => webview.contentOptions = value); + this._withWebview(webview => webview.contentOptions = value); } public set localResourcesRoot(resources: URI[]) { - this.withWebview(webview => webview.localResourcesRoot = resources); + this._withWebview(webview => webview.localResourcesRoot = resources); } private readonly _onDidFocus = this._register(new Emitter()); @@ -355,7 +355,7 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { runFindAction(previous: boolean): void { this._webview.value?.runFindAction(previous); } - private withWebview(f: (webview: IWebview) => void): void { + private _withWebview(f: (webview: IWebview) => void): void { if (this._webview.value) { f(this._webview.value); } diff --git a/src/vs/workbench/contrib/webview/browser/themeing.ts b/src/vs/workbench/contrib/webview/browser/themeing.ts index 12a4c8effd1ff..4fd074d18aeec 100644 --- a/src/vs/workbench/contrib/webview/browser/themeing.ts +++ b/src/vs/workbench/contrib/webview/browser/themeing.ts @@ -34,13 +34,13 @@ export class WebviewThemeDataProvider extends Disposable { super(); this._register(this._themeService.onDidColorThemeChange(() => { - this.reset(); + this._reset(); })); const webviewConfigurationKeys = ['editor.fontFamily', 'editor.fontWeight', 'editor.fontSize']; this._register(this._configurationService.onDidChangeConfiguration(e => { if (webviewConfigurationKeys.some(key => e.affectsConfiguration(key))) { - this.reset(); + this._reset(); } })); } @@ -82,7 +82,7 @@ export class WebviewThemeDataProvider extends Disposable { return this._cachedWebViewThemeData; } - private reset() { + private _reset() { this._cachedWebViewThemeData = undefined; this._onThemeDataChanged.fire(); } diff --git a/src/vs/workbench/contrib/webview/browser/webview.ts b/src/vs/workbench/contrib/webview/browser/webview.ts index b57628ca9c3f2..6866db114f87e 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.ts @@ -299,32 +299,32 @@ export interface IOverlayWebview extends IWebview { */ export class WebviewOriginStore { - private readonly memento: Memento; - private readonly state: MementoObject; + private readonly _memento: Memento; + private readonly _state: MementoObject; constructor( rootStorageKey: string, @IStorageService storageService: IStorageService, ) { - this.memento = new Memento(rootStorageKey, storageService); - this.state = this.memento.getMemento(StorageScope.APPLICATION, StorageTarget.MACHINE); + this._memento = new Memento(rootStorageKey, storageService); + this._state = this._memento.getMemento(StorageScope.APPLICATION, StorageTarget.MACHINE); } public getOrigin(viewType: string, additionalKey: string | undefined): string { - const key = this.getKey(viewType, additionalKey); + const key = this._getKey(viewType, additionalKey); - const existing = this.state[key]; + const existing = this._state[key]; if (existing && typeof existing === 'string') { return existing; } const newOrigin = generateUuid(); - this.state[key] = newOrigin; - this.memento.saveMemento(); + this._state[key] = newOrigin; + this._memento.saveMemento(); return newOrigin; } - private getKey(viewType: string, additionalKey: string | undefined): string { + private _getKey(viewType: string, additionalKey: string | undefined): string { return JSON.stringify({ viewType, key: additionalKey }); } } @@ -336,16 +336,16 @@ export class WebviewOriginStore { */ export class ExtensionKeyedWebviewOriginStore { - private readonly store: WebviewOriginStore; + private readonly _store: WebviewOriginStore; constructor( rootStorageKey: string, @IStorageService storageService: IStorageService, ) { - this.store = new WebviewOriginStore(rootStorageKey, storageService); + this._store = new WebviewOriginStore(rootStorageKey, storageService); } public getOrigin(viewType: string, extId: ExtensionIdentifier): string { - return this.store.getOrigin(viewType, extId.value); + return this._store.getOrigin(viewType, extId.value); } } diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index 19a1ec39e8e86..bb16d3bfd3b29 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -125,10 +125,10 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD /** * Unique internal identifier of this webview's iframe element. */ - private readonly iframeId: string; + private readonly _iframeId: string; - private readonly encodedWebviewOriginPromise: Promise; - private encodedWebviewOrigin: string | undefined; + private readonly _encodedWebviewOriginPromise: Promise; + private _encodedWebviewOrigin: string | undefined; protected get platform(): string { return 'browser'; } @@ -152,7 +152,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD private _state: WebviewState.State = new WebviewState.Initializing([]); - private content: WebviewContent; + private _content: WebviewContent; private readonly _portMappingManager: WebviewPortMappingManager; @@ -167,7 +167,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD private readonly _onDidHtmlChange: Emitter = this._register(new Emitter()); protected readonly onDidHtmlChange = this._onDidHtmlChange.event; - private messagePort?: MessagePort; + private _messagePort?: MessagePort; private readonly _messageHandlers = new Map void>>(); protected readonly _webviewFindWidget: WebviewFindWidget | undefined; @@ -177,7 +177,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD public extension: WebviewExtensionDescription | undefined; - private readonly options: WebviewOptions; + private readonly _options: WebviewOptions; constructor( initInfo: WebviewInitInfo, @@ -199,15 +199,15 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.id = initInfo.id; this.providedViewType = initInfo.providedViewType; - this.iframeId = generateUuid(); - this.origin = initInfo.origin ?? this.iframeId; + this._iframeId = generateUuid(); + this.origin = initInfo.origin ?? this._iframeId; - this.encodedWebviewOriginPromise = parentOriginHash(window.origin, this.origin).then(id => this.encodedWebviewOrigin = id); + this._encodedWebviewOriginPromise = parentOriginHash(window.origin, this.origin).then(id => this._encodedWebviewOrigin = id); - this.options = initInfo.options; + this._options = initInfo.options; this.extension = initInfo.extension; - this.content = { + this._content = { html: '', options: initInfo.contentOptions, state: undefined @@ -215,32 +215,32 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this._portMappingManager = this._register(new WebviewPortMappingManager( () => this.extension?.location, - () => this.content.options.portMapping || [], + () => this._content.options.portMapping || [], this._tunnelService )); - this._element = this.createElement(initInfo.options, initInfo.contentOptions); + this._element = this._createElement(initInfo.options, initInfo.contentOptions); const subscription = this._register(addDisposableListener(window, 'message', (e: MessageEvent) => { - if (!this.encodedWebviewOrigin || e?.data?.target !== this.iframeId) { + if (!this._encodedWebviewOrigin || e?.data?.target !== this._iframeId) { return; } - if (e.origin !== this.webviewContentOrigin(this.encodedWebviewOrigin)) { - console.log(`Skipped renderer receiving message due to mismatched origins: ${e.origin} ${this.webviewContentOrigin}`); + if (e.origin !== this._webviewContentOrigin(this._encodedWebviewOrigin)) { + console.log(`Skipped renderer receiving message due to mismatched origins: ${e.origin} ${this._webviewContentOrigin}`); return; } if (e.data.channel === WebviewMessageChannels.webviewReady) { - if (this.messagePort) { + if (this._messagePort) { return; } this._logService.debug(`Webview(${this.id}): webview ready`); - this.messagePort = e.ports[0]; - this.messagePort.onmessage = (e) => { + this._messagePort = e.ports[0]; + this._messagePort.onmessage = (e) => { const handlers = this._messageHandlers.get(e.data.channel); if (!handlers) { console.log(`No handlers found for '${e.data.channel}'`); @@ -381,7 +381,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD })); this._register(this.on(WebviewMessageChannels.dragStart, () => { - this.startBlockingIframeDragEvents(); + this._startBlockingIframeDragEvents(); })); if (initInfo.options.enableFindWidget) { @@ -389,9 +389,9 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.styledFindWidget(); } - this.encodedWebviewOriginPromise.then(encodedWebviewOrigin => { + this._encodedWebviewOriginPromise.then(encodedWebviewOrigin => { if (!this._disposed) { - this.initElement(encodedWebviewOrigin, this.extension, this.options); + this._initElement(encodedWebviewOrigin, this.extension, this._options); } }); } @@ -402,7 +402,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.element?.remove(); this._element = undefined; - this.messagePort = undefined; + this._messagePort = undefined; if (this._state.type === WebviewState.Type.Initializing) { for (const message of this._state.pendingMessages) { @@ -456,18 +456,18 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD return this._send('message', { message, transfer }); } - private async _send(channel: string, data?: any, transferable: Transferable[] = []): Promise { + private async _send(channel: string, data?: any, _createElement: Transferable[] = []): Promise { if (this._state.type === WebviewState.Type.Initializing) { let resolve: (x: boolean) => void; const promise = new Promise(r => resolve = r); - this._state.pendingMessages.push({ channel, data, transferable, resolve: resolve! }); + this._state.pendingMessages.push({ channel, data, transferable: _createElement, resolve: resolve! }); return promise; } else { - return this.doPostMessage(channel, data, transferable); + return this.doPostMessage(channel, data, _createElement); } } - private createElement(options: WebviewOptions, _contentOptions: WebviewContentOptions) { + private _createElement(options: WebviewOptions, _contentOptions: WebviewContentOptions) { // Do not start loading the webview yet. // Wait the end of the ctor when all listeners have been hooked up. const element = document.createElement('iframe'); @@ -487,16 +487,16 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD element.style.height = '100%'; element.focus = () => { - this.doFocus(); + this._doFocus(); }; return element; } - private initElement(encodedWebviewOrigin: string, extension: WebviewExtensionDescription | undefined, options: WebviewOptions) { + private _initElement(encodedWebviewOrigin: string, extension: WebviewExtensionDescription | undefined, options: WebviewOptions) { // The extensionId and purpose in the URL are used for filtering in js-debug: const params: { [key: string]: string } = { - id: this.iframeId, + id: this._iframeId, origin: this.origin, swVersion: String(this._expectedServiceWorkerVersion), extensionId: extension?.id.value ?? '', @@ -523,37 +523,37 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.element!.setAttribute('src', `${this.webviewContentEndpoint(encodedWebviewOrigin)}/${fileName}?${queryString}`); } - public mountTo(parent: HTMLElement) { + public mountTo(_stopBlockingIframeDragEvents: HTMLElement) { if (!this.element) { return; } if (this._webviewFindWidget) { - parent.appendChild(this._webviewFindWidget.getDomNode()); + _stopBlockingIframeDragEvents.appendChild(this._webviewFindWidget.getDomNode()); } for (const eventName of [EventType.MOUSE_DOWN, EventType.MOUSE_MOVE, EventType.DROP]) { - this._register(addDisposableListener(parent, eventName, () => { - this.stopBlockingIframeDragEvents(); + this._register(addDisposableListener(_stopBlockingIframeDragEvents, eventName, () => { + this._stopBlockingIframeDragEvents(); })); } - for (const node of [parent, window]) { + for (const node of [_stopBlockingIframeDragEvents, window]) { this._register(addDisposableListener(node, EventType.DRAG_END, () => { - this.stopBlockingIframeDragEvents(); + this._stopBlockingIframeDragEvents(); })); } - parent.appendChild(this.element); + _stopBlockingIframeDragEvents.appendChild(this.element); } - private startBlockingIframeDragEvents() { + private _startBlockingIframeDragEvents() { if (this.element) { this.element.style.pointerEvents = 'none'; } } - private stopBlockingIframeDragEvents() { + private _stopBlockingIframeDragEvents() { if (this.element) { this.element.style.pointerEvents = 'auto'; } @@ -572,14 +572,14 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD return endpoint; } - private webviewContentOrigin(encodedWebviewOrigin: string): string { + private _webviewContentOrigin(encodedWebviewOrigin: string): string { const uri = URI.parse(this.webviewContentEndpoint(encodedWebviewOrigin)); return uri.scheme + '://' + uri.authority.toLowerCase(); } private doPostMessage(channel: string, data?: any, transferable: Transferable[] = []): boolean { - if (this.element && this.messagePort) { - this.messagePort.postMessage({ channel, args: data }, transferable); + if (this.element && this._messagePort) { + this._messagePort.postMessage({ channel, args: data }, transferable); return true; } return false; @@ -625,7 +625,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD } public reload(): void { - this.doUpdateContent(this.content); + this.doUpdateContent(this._content); const subscription = this._register(this.on(WebviewMessageChannels.didLoad, () => { this._onDidReload.fire(); @@ -636,8 +636,8 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD public set html(value: string) { this.doUpdateContent({ html: value, - options: this.content.options, - state: this.content.state, + options: this._content.options, + state: this._content.state, }); this._onDidHtmlChange.fire(value); } @@ -645,29 +645,29 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD public set contentOptions(options: WebviewContentOptions) { this._logService.debug(`Webview(${this.id}): will update content options`); - if (areWebviewContentOptionsEqual(options, this.content.options)) { + if (areWebviewContentOptionsEqual(options, this._content.options)) { this._logService.debug(`Webview(${this.id}): skipping content options update`); return; } this.doUpdateContent({ - html: this.content.html, + html: this._content.html, options: options, - state: this.content.state, + state: this._content.state, }); } public set localResourcesRoot(resources: readonly URI[]) { - this.content = { - ...this.content, - options: { ...this.content.options, localResourceRoots: resources } + this._content = { + ...this._content, + options: { ...this._content.options, localResourceRoots: resources } }; } public set state(state: string | undefined) { - this.content = { - html: this.content.html, - options: this.content.options, + this._content = { + html: this._content.html, + options: this._content.options, state, }; } @@ -679,17 +679,17 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD private doUpdateContent(newContent: WebviewContent) { this._logService.debug(`Webview(${this.id}): will update content`); - this.content = newContent; + this._content = newContent; - const allowScripts = !!this.content.options.allowScripts; + const allowScripts = !!this._content.options.allowScripts; this._send('content', { - contents: this.content.html, + contents: this._content.html, options: { - allowMultipleAPIAcquire: !!this.content.options.allowMultipleAPIAcquire, + allowMultipleAPIAcquire: !!this._content.options.allowMultipleAPIAcquire, allowScripts: allowScripts, - allowForms: this.content.options.allowForms ?? allowScripts, // For back compat, we allow forms by default when scripts are enabled + allowForms: this._content.options.allowForms ?? allowScripts, // For back compat, we allow forms by default when scripts are enabled }, - state: this.content.state, + state: this._content.state, cspSource: webviewGenericCspSource, confirmBeforeClose: this._confirmBeforeClose, }); @@ -697,8 +697,8 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD protected style(): void { let { styles, activeTheme, themeLabel, themeId } = this.webviewThemeDataProvider.getWebviewThemeData(); - if (this.options.transformCssVariables) { - styles = this.options.transformCssVariables(styles); + if (this._options.transformCssVariables) { + styles = this._options.transformCssVariables(styles); } const reduceMotion = this._accessibilityService.isMotionReduced(); @@ -737,11 +737,11 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD // Webview break drag and dropping around the main window (no events are generated when you are over them) // Work around this by disabling pointer events during the drag. // https://github.com/electron/electron/issues/18226 - this.startBlockingIframeDragEvents(); + this._startBlockingIframeDragEvents(); } windowDidDragEnd(): void { - this.stopBlockingIframeDragEvents(); + this._stopBlockingIframeDragEvents(); } public selectAll() { @@ -778,7 +778,7 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD try { const result = await loadLocalResource(uri, { ifNoneMatch, - roots: this.content.options.localResourceRoots || [], + roots: this._content.options.localResourceRoots || [], }, this._fileService, this._logService, this._resourceLoadingCts.token); switch (result.type) { @@ -839,13 +839,13 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD } public focus(): void { - this.doFocus(); + this._doFocus(); // Handle focus change programmatically (do not rely on event from ) this.handleFocusChange(true); } - private doFocus() { + private _doFocus() { if (!this.element) { return; } diff --git a/src/vs/workbench/contrib/webview/browser/webviewService.ts b/src/vs/workbench/contrib/webview/browser/webviewService.ts index b1e7873307e6c..9e1d51b89cc6b 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewService.ts @@ -27,7 +27,7 @@ export class WebviewService extends Disposable implements IWebviewService { public get activeWebview() { return this._activeWebview; } - private updateActiveWebview(value: IWebview | undefined) { + private _updateActiveWebview(value: IWebview | undefined) { if (value !== this._activeWebview) { this._activeWebview = value; this._onDidChangeActiveWebview.fire(value); @@ -59,12 +59,12 @@ export class WebviewService extends Disposable implements IWebviewService { this._webviews.add(webview); webview.onDidFocus(() => { - this.updateActiveWebview(webview); + this._updateActiveWebview(webview); }); const onBlur = () => { if (this._activeWebview === webview) { - this.updateActiveWebview(undefined); + this._updateActiveWebview(undefined); } }; diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts index 9c4003f02dfb4..70c635de4f79a 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts @@ -57,7 +57,7 @@ export class ElectronWebviewElement extends WebviewElement { @IConfigurationService configurationService: IConfigurationService, @IMainProcessService mainProcessService: IMainProcessService, @INotificationService notificationService: INotificationService, - @INativeHostService private readonly nativeHostService: INativeHostService, + @INativeHostService private readonly _nativeHostService: INativeHostService, @IInstantiationService instantiationService: IInstantiationService, @IAccessibilityService accessibilityService: IAccessibilityService, ) { @@ -65,7 +65,7 @@ export class ElectronWebviewElement extends WebviewElement { configurationService, contextMenuService, menuService, notificationService, environmentService, fileService, logService, remoteAuthorityResolverService, telemetryService, tunnelService, instantiationService, accessibilityService); - this._webviewKeyboardHandler = new WindowIgnoreMenuShortcutsManager(configurationService, mainProcessService, nativeHostService); + this._webviewKeyboardHandler = new WindowIgnoreMenuShortcutsManager(configurationService, mainProcessService, _nativeHostService); this._webviewMainService = ProxyChannel.toService(mainProcessService.getChannel('webview')); @@ -127,7 +127,7 @@ export class ElectronWebviewElement extends WebviewElement { } else { // continuing the find, so set findNext to false const options: FindInFrameOptions = { forward: !previous, findNext: false, matchCase: false }; - this._webviewMainService.findInFrame({ windowId: this.nativeHostService.windowId }, this.id, value, options); + this._webviewMainService.findInFrame({ windowId: this._nativeHostService.windowId }, this.id, value, options); } } @@ -145,7 +145,7 @@ export class ElectronWebviewElement extends WebviewElement { this._iframeDelayer.trigger(() => { this._findStarted = true; - this._webviewMainService.findInFrame({ windowId: this.nativeHostService.windowId }, this.id, value, options); + this._webviewMainService.findInFrame({ windowId: this._nativeHostService.windowId }, this.id, value, options); }); } @@ -155,7 +155,7 @@ export class ElectronWebviewElement extends WebviewElement { } this._iframeDelayer.cancel(); this._findStarted = false; - this._webviewMainService.stopFindInFrame({ windowId: this.nativeHostService.windowId }, this.id, { + this._webviewMainService.stopFindInFrame({ windowId: this._nativeHostService.windowId }, this.id, { keepSelection }); this._onDidStopFind.fire(); diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts b/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts index ba3258b9545bd..6d6df9c129267 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts @@ -14,16 +14,16 @@ export class WindowIgnoreMenuShortcutsManager { private readonly _isUsingNativeTitleBars: boolean; - private readonly webviewMainService: IWebviewManagerService; + private readonly _webviewMainService: IWebviewManagerService; constructor( configurationService: IConfigurationService, mainProcessService: IMainProcessService, - private readonly nativeHostService: INativeHostService + private readonly _nativeHostService: INativeHostService ) { this._isUsingNativeTitleBars = configurationService.getValue('window.titleBarStyle') === 'native'; - this.webviewMainService = ProxyChannel.toService(mainProcessService.getChannel('webview')); + this._webviewMainService = ProxyChannel.toService(mainProcessService.getChannel('webview')); } public didFocus(): void { @@ -34,13 +34,13 @@ export class WindowIgnoreMenuShortcutsManager { this.setIgnoreMenuShortcuts(false); } - private get shouldToggleMenuShortcutsEnablement() { + private get _shouldToggleMenuShortcutsEnablement() { return isMacintosh || this._isUsingNativeTitleBars; } protected setIgnoreMenuShortcuts(value: boolean) { - if (this.shouldToggleMenuShortcutsEnablement) { - this.webviewMainService.setIgnoreMenuShortcuts({ windowId: this.nativeHostService.windowId }, value); + if (this._shouldToggleMenuShortcutsEnablement) { + this._webviewMainService.setIgnoreMenuShortcuts({ windowId: this._nativeHostService.windowId }, value); } } }