@@ -9,7 +9,6 @@ import type { IDisposable } from 'vs/base/common/lifecycle';
9
9
import type * as webviewMessages from 'vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages' ;
10
10
import type { NotebookCellMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
11
11
import type * as rendererApi from 'vscode-notebook-renderer' ;
12
- import * as browser from 'vs/base/browser/browser' ;
13
12
14
13
// !! IMPORTANT !! ----------------------------------------------------------------------------------
15
14
// import { RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
@@ -92,6 +91,8 @@ declare function __import(path: string): Promise<any>;
92
91
async function webviewPreloads ( ctx : PreloadContext ) {
93
92
// eslint-disable-next-line no-restricted-globals
94
93
const $window = window as typeof DOM . $window ;
94
+ const userAgent = navigator . userAgent ;
95
+ const isChrome = ( userAgent . indexOf ( 'Chrome' ) >= 0 ) ;
95
96
const textEncoder = new TextEncoder ( ) ;
96
97
const textDecoder = new TextDecoder ( ) ;
97
98
@@ -484,9 +485,9 @@ async function webviewPreloads(ctx: PreloadContext) {
484
485
deltaY : event . deltaY ,
485
486
deltaZ : event . deltaZ ,
486
487
// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928
487
- wheelDelta : event . wheelDelta && browser . isChrome ? ( event . wheelDelta / $window . devicePixelRatio ) : event . wheelDelta ,
488
- wheelDeltaX : event . wheelDeltaX && browser . isChrome ? ( event . wheelDeltaX / $window . devicePixelRatio ) : event . wheelDeltaX ,
489
- wheelDeltaY : event . wheelDeltaY && browser . isChrome ? ( event . wheelDeltaY / $window . devicePixelRatio ) : event . wheelDeltaY ,
488
+ wheelDelta : event . wheelDelta && isChrome ? ( event . wheelDelta / $window . devicePixelRatio ) : event . wheelDelta ,
489
+ wheelDeltaX : event . wheelDeltaX && isChrome ? ( event . wheelDeltaX / $window . devicePixelRatio ) : event . wheelDeltaX ,
490
+ wheelDeltaY : event . wheelDeltaY && isChrome ? ( event . wheelDeltaY / $window . devicePixelRatio ) : event . wheelDeltaY ,
490
491
detail : event . detail ,
491
492
shiftKey : event . shiftKey ,
492
493
type : event . type
0 commit comments