1 import { SupportedBrowserValue } from './interface';
4 * This file is included in the main bundle. Its main purpose is to find out if the main bundle could execute,
5 * or if it errored out due to a Syntax Error since the main bundle is only compiled against a specific list
6 * of browsers. We also check some specific browsers here.
7 * The unsupported.js script is included as another script tag and relies on this variable.
9 const isUnsupported = () => {
10 // IE11 or old edge (not chromium based) are not supported.
11 const isOldEdgeOrIE = !('reversed' in document.createElement('ol'));
12 // If these function get polyfilled they'll exist, this is a safety mechanism for when we stop supporting it
13 return isOldEdgeOrIE || !Object.fromEntries || !''.trimStart || !window.crypto.subtle;
16 window.protonSupportedBrowser = isUnsupported() ? SupportedBrowserValue.Unsupported : SupportedBrowserValue.Supported;