var displayMessage = function (s) {
s = s || 'regular';
var notSeenSince = Date.now() - parseInt(window.localStorage.getItem('browser_support_last_seen'), 10);
if ( s === 'modern' || s === 'regular') return;
if ( notSeenSince < (1000 * 60 * 60 * 24) && !false ) return;
try {
window.localStorage.setItem('browser_support_last_seen', Date.now());
} catch (e) {}
var message = '', title = '', popup = document.createElement('div');
var popupTemplate = function (title, message) { return '
' + title + '
' + message + '
Please update your browser for the best and most secure experience on our site.
'}
if (s === 'pre_deprecation') {
title = 'Impending deprecation';
message = 'Your browser is out of date. We will stop supporting this browser shortly.';
} else if (s === 'deprecated') {
title = 'Unsupported browser';
message = 'Your browser is out of date, so some Sketchfab features may not work as intended.';
}
popup.className = 'popup-container browser-support-popup';
popup.innerHTML = popupTemplate(title, message);
popup.addEventListener('click', function() { popup.parentElement.removeChild(popup); })
document.body.appendChild(popup);
}
var checkSupport = function (done) {
var v = window.localStorage.getItem('browser_support');
if ( !v ) {
var r = new XMLHttpRequest();
r.addEventListener('load', function () {
v = JSON.parse(this.responseText).support;
try {
window.localStorage.setItem('browser_support', v);
} catch (e) {}
done(v);
});
r.open('GET', '/i/browser-support');
r.send();
} else { done(v) }
}
checkSupport(displayMessage);
x server