As correctly commented on - this task is divided into two. The first is to determine that the user's browser is not supported by the site. The second is to display a window that is most compatible with all ancient browsers.
The second task is still perfectly solved by the plugin http://jreject.turnwheel.com . For the first task, as @Alexey Ten wrote, you need to check the availability of critical features.
For example, the decision on the issue (popup with no support for flexbox):
var tst = document.createElement("div"); var flexSupportCaps = [ tst.style.flex, tst.style.flexWrap, tst.style.flexFlow, tst.style.flexGrow, tst.style.alignContent, tst.style.alignItems, tst.style.alignSelf, tst.style.justifyContent, tst.style.order ]; if (flexSupportCaps.indexOf(undefined)!=-1){ $(document).ready(function(){ $.reject({ reject: { all: true }, // Reject all renderers for demo header: 'Браузер не поддерживается', // Header Text paragraph1: 'Вы используете устаревший браузер.', // Paragraph 1 paragraph2: 'Для корректной работы портала vashsite.ru рекомендуем установить один из следущих браузеров, или обновить ваш до последней версии.', closeLink: 'Закрыть окно', closeMessage: 'Я согласен с тем, что отображение сайта может быть некорректно.', imagePath: '/externals/jReject-master/images/', closeCookie: true, browserInfo: { msie: { text: 'Microsoft Edge', url: 'https://www.microsoft.com/ru-ru/windows/microsoft-edge' } } }); }); } delete tst;
Flexbox support is detected, if it is not there, the pop-up jReject plug-in is spat out. It spits out once, as the closeCookie: true
parameter closeCookie: true
.