This library determines if a browser supports Mapbox GL JS.
You may test your browser here.
<script src='mapbox-gl-supported.js'></script>
<script>
if (mapboxgl.isSupported()) {
...
} else {
...
}
</script>npm install --save @mapbox/mapbox-gl-supportedimport {isSupported} from '@mapbox/mapbox-gl-supported';
if (isSupported()) {
...
}