diff --git a/addons/addon-webgl/src/WebglAddon.ts b/addons/addon-webgl/src/WebglAddon.ts index 16b1e4443d..2b3a7f9658 100644 --- a/addons/addon-webgl/src/WebglAddon.ts +++ b/addons/addon-webgl/src/WebglAddon.ts @@ -11,6 +11,7 @@ import { EventEmitter, forwardEvent } from 'common/EventEmitter'; import { Disposable, toDisposable } from 'common/Lifecycle'; import { getSafariVersion, isSafari } from 'common/Platform'; import { ICoreService, IDecorationService, ILogService, IOptionsService } from 'common/services/Services'; +import { IWebGL2RenderingContext } from './Types'; import { WebglRenderer } from './WebglRenderer'; import { setTraceLogger } from 'common/services/LogService'; @@ -31,7 +32,16 @@ export class WebglAddon extends Disposable implements ITerminalAddon , IWebglApi private _preserveDrawingBuffer?: boolean ) { if (isSafari && getSafariVersion() < 16) { - throw new Error('Webgl2 is only supported on Safari 16 and above'); + // Perform an extra check to determine if Webgl2 is manually enabled in developer settings + const contextAttributes = { + antialias: false, + depth: false, + preserveDrawingBuffer: true + }; + const gl = document.createElement('canvas').getContext('webgl2', contextAttributes) as IWebGL2RenderingContext; + if (!gl) { + throw new Error('Webgl2 is only supported on Safari 16 and above'); + } } super(); }