Remove browser engine detection
It is out of date and not used anyway.
This commit is contained in:
parent
099eb856cf
commit
fb7e99e84b
|
@ -10,7 +10,7 @@
|
|||
/*jslint browser: true, white: false */
|
||||
/*global Util, Base64, changeCursor */
|
||||
|
||||
import { Engine, browserSupportsCursorURIs as cursorURIsSupported } from './util/browsers.js';
|
||||
import { browserSupportsCursorURIs as cursorURIsSupported } from './util/browsers.js';
|
||||
import { set_defaults, make_properties } from './util/properties.js';
|
||||
import * as Log from './util/logging.js';
|
||||
import Base64 from "./base64.js";
|
||||
|
@ -70,10 +70,6 @@ export default function Display(defaults) {
|
|||
bottom: this._backbuffer.height };
|
||||
|
||||
Log.Debug("User Agent: " + navigator.userAgent);
|
||||
if (Engine.gecko) { Log.Debug("Browser: gecko " + Engine.gecko); }
|
||||
if (Engine.webkit) { Log.Debug("Browser: webkit " + Engine.webkit); }
|
||||
if (Engine.trident) { Log.Debug("Browser: trident " + Engine.trident); }
|
||||
if (Engine.presto) { Log.Debug("Browser: presto " + Engine.presto); }
|
||||
|
||||
this.clear();
|
||||
|
||||
|
|
|
@ -8,73 +8,6 @@
|
|||
|
||||
import * as Log from './logging.js';
|
||||
|
||||
// Set browser engine versions. Based on mootools.
|
||||
const Features = {xpath: !!(document.evaluate), query: !!(document.querySelector)};
|
||||
|
||||
// 'presto': (function () { return (!window.opera) ? false : true; }()),
|
||||
var detectPresto = function () {
|
||||
return !!window.opera;
|
||||
};
|
||||
|
||||
// 'trident': (function () { return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4);
|
||||
var detectTrident = function () {
|
||||
if (!window.ActiveXObject) {
|
||||
return false;
|
||||
} else {
|
||||
if (window.XMLHttpRequest) {
|
||||
return (document.querySelectorAll) ? 6 : 5;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 'webkit': (function () { try { return (navigator.taintEnabled) ? false : ((Features.xpath) ? ((Features.query) ? 525 : 420) : 419); } catch (e) { return false; } }()),
|
||||
var detectInitialWebkit = function () {
|
||||
try {
|
||||
if (navigator.taintEnabled) {
|
||||
return false;
|
||||
} else {
|
||||
if (Features.xpath) {
|
||||
return (Features.query) ? 525 : 420;
|
||||
} else {
|
||||
return 419;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
var detectActualWebkit = function (initial_ver) {
|
||||
var re = /WebKit\/([0-9\.]*) /;
|
||||
var str_ver = (navigator.userAgent.match(re) || ['', initial_ver])[1];
|
||||
return parseFloat(str_ver, 10);
|
||||
};
|
||||
|
||||
// 'gecko': (function () { return (!document.getBoxObjectFor && window.mozInnerScreenX == null) ? false : ((document.getElementsByClassName) ? 19ssName) ? 19 : 18 : 18); }())
|
||||
var detectGecko = function () {
|
||||
/* jshint -W041 */
|
||||
if (!document.getBoxObjectFor && window.mozInnerScreenX == null) {
|
||||
return false;
|
||||
} else {
|
||||
return (document.getElementsByClassName) ? 19 : 18;
|
||||
}
|
||||
/* jshint +W041 */
|
||||
};
|
||||
|
||||
const isWebkitInitial = detectInitialWebkit();
|
||||
|
||||
export const Engine = {
|
||||
// Version detection break in Opera 11.60 (errors on arguments.callee.caller reference)
|
||||
//'presto': (function() {
|
||||
// return (!window.opera) ? false : ((arguments.callee.caller) ? 960 : ((document.getElementsByClassName) ? 950 : 925)); }()),
|
||||
'presto': detectPresto(),
|
||||
'trident': detectTrident(),
|
||||
'webkit': isWebkitInitial ? detectActualWebkit(isWebkitInitial) : false,
|
||||
'gecko': detectGecko()
|
||||
};
|
||||
|
||||
// Touch detection
|
||||
export var isTouchDevice = ('ontouchstart' in document.documentElement) ||
|
||||
// requried for Chrome debugger
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
canvas, keyboard, mouse;
|
||||
|
||||
var newline = "\n";
|
||||
if (Util.Engine.trident) {
|
||||
var newline = "<br>\n";
|
||||
}
|
||||
|
||||
function message(str) {
|
||||
console.log(str);
|
||||
|
|
Loading…
Reference in New Issue