Index: web/pgadmin/browser/templates/browser/browser.html IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- web/pgadmin/browser/templates/browser/browser.html (date 1586870426046) +++ web/pgadmin/browser/templates/browser/browser.html (date 1586870426046) @@ -0,0 +1,13 @@ +{% if known %} +
{{ _('Your browser was detected as {0} version + {1}, which is either deprecated or not supported by + pgAdmin 4.').format(browser, version) }}
+{% else %} +{{ _('Your browser was detected as {0} version + {1}, which pgAdmin has not been tested with. pgAdmin may + not work as expected, and any issues reported when using this browser may + not be fixed.').format(browser, version) }}
+{% endif %} +{{ _('Please visit the FAQ to see the + supported browsers.') }}
Index: web/config.py IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- web/config.py (revision 65bc196ebab314178bf9523f91ef9f9f07d5e4e8) +++ web/config.py (date 1586869660607) @@ -359,6 +359,9 @@ CA_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "cacert.pem") +# Check if the detected browser is supported +CHECK_SUPPORTED_BROWSER = True + ########################################################################## # Storage Manager storage url config settings # If user sets STORAGE_DIR to empty it will show all volumes if platform Index: web/pgadmin/browser/__init__.py IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- web/pgadmin/browser/__init__.py (revision 65bc196ebab314178bf9523f91ef9f9f07d5e4e8) +++ web/pgadmin/browser/__init__.py (date 1586870498522) @@ -543,6 +543,41 @@ base_url=None ) + # Check the browser is a support version + # NOTE: If the checks here are updated, make sure the supported versions + # at https://www.pgadmin.org/faq/#11 are updated to match! + if config.CHECK_SUPPORTED_BROWSER: + browser = request.user_agent.browser + version = request.user_agent.version and int( + request.user_agent.version.split('.')[0]) + + browser_name = None + browser_known = True + if browser == 'chrome' and version < 72: + browser_name = 'Chrome' + elif browser == 'firefox' and version < 65: + browser_name = 'Firefox' + elif browser == 'edge' and version < 44: + browser_name = 'Edge' + elif browser == 'safari' and version < 12: + browser_name = 'Safari' + elif browser == 'msie': + browser_name = 'Internet Explorer' + elif browser != 'chrom' and browser != 'firefox' and \ + browser != 'edge' and browser != 'safari': + browser_name = browser + browser_known = False + + if browser_name is not None: + msg = render_template( + MODULE_NAME + "/browser.html", + version=version, + browser=browser_name, + known=browser_known + ) + + flash(msg, 'warning') + # Get the current version info from the website, and flash a message if # the user is out of date, and the check is enabled. if config.UPGRADE_CHECK_ENABLED: