mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user