@happysanta/router
Version:
Router for VKUI
36 lines (30 loc) • 948 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.preventBlinkingBySettingScrollRestoration = preventBlinkingBySettingScrollRestoration;
exports.getDisplayName = getDisplayName;
exports.isDesktopSafari = isDesktopSafari;
/**
* @ignore
* @packageDocumentation
*/
/**
* @ignore
*/
function preventBlinkingBySettingScrollRestoration() {
if ('scrollRestoration' in window.history && window.history.scrollRestoration === 'auto') {
window.history.scrollRestoration = 'manual';
}
}
/**
* @ignore
* @param WrappedComponent
*/
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
function isDesktopSafari() {
var ua = window.navigator.userAgent;
return ua.indexOf('AppleWebKit/') > 0 && ua.indexOf('Safari/') > 0 && !ua.includes('Chrome/') && !ua.includes('Mobile/') && !ua.includes('Android') && !ua.includes('iPhone');
}