fix!: remove checks for IE and EdgeHTML in core (#6336)

* chore: remove uses of userAgent.IE

* chore!: remove export of userAgent.IE

* format: run format

* fix!: remove special-cases for EdgeHTML browser engine

* fix!: remove export of userAgent.EDGE

* chore: remove unused dependencies

* fix: touch events in non-touch firefox
This commit is contained in:
Rachel Fenichel
2022-08-17 14:13:13 -04:00
committed by GitHub
parent e10bf99936
commit ffe6d55d5f
12 changed files with 36 additions and 89 deletions

View File

@@ -23,10 +23,6 @@ goog.declareModuleId('Blockly.utils.userAgent');
/** The raw useragent string. */
let rawUserAgent: string;
let isIe: boolean;
let isEdge: boolean;
let isJavaFx: boolean;
let isChrome: boolean;
@@ -63,18 +59,16 @@ function has(name: string): boolean {
// Browsers. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/browser.js
isIe = has('Trident') || has('MSIE');
isEdge = has('Edge');
// Useragent for JavaFX:
// Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.44
// (KHTML, like Gecko) JavaFX/8.0 Safari/537.44
isJavaFx = has('JavaFX');
isChrome = (has('Chrome') || has('CriOS')) && !isEdge;
isChrome = (has('Chrome') || has('CriOS'));
// Engines. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/engine.js
isWebKit = has('WebKit') && !isEdge;
isGecko = has('Gecko') && !isWebKit && !isIe && !isEdge;
isWebKit = has('WebKit');
isGecko = has('Gecko') && !isWebKit;
// Platforms. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/platform.js
@@ -97,12 +91,6 @@ isMobile = !isTablet && (isIPod || isIPhone || isAndroid || has('IEMobile'));
/** @alias Blockly.utils.userAgent.raw */
export const raw: string = rawUserAgent;
/** @alias Blockly.utils.userAgent.IE */
export const IE: boolean = isIe;
/** @alias Blockly.utils.userAgent.EDGE */
export const EDGE: boolean = isEdge;
/** @alias Blockly.utils.userAgent.JavaFx */
export const JavaFx: boolean = isJavaFx;
@@ -111,6 +99,7 @@ export const CHROME: boolean = isChrome;
/** @alias Blockly.utils.userAgent.WEBKIT */
export const WEBKIT: boolean = isWebKit;
/** @alias Blockly.utils.userAgent.GECKO */
export const GECKO: boolean = isGecko;