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 1586431105718) +++ web/pgadmin/browser/templates/browser/browser.html (date 1586431105718) @@ -0,0 +1,5 @@ +
{{ _('Your browser was detected as {0} version {1}, which is either + deprecated or not supported by pgAdmin 4.').format(browser, version) }}
+{{ _('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 8a550b569ff5aadb8c2d99cbef4a4233ab00e413) +++ web/config.py (date 1586430908666) @@ -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 8a550b569ff5aadb8c2d99cbef4a4233ab00e413) +++ web/pgadmin/browser/__init__.py (date 1586431972063) @@ -543,6 +543,38 @@ 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 + 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 != 'chrome' and browser != 'firefox' and \ + browser != 'edge' and browser != 'safari': + browser_name = browser + + if browser_name is not None: + msg = render_template( + MODULE_NAME + "/browser.html", + version=version, + browser=browser_name + ) + + 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: