File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import {
3131 validate ,
3232 mouseNotification ,
3333 getManifestVersion ,
34+ isChromium ,
3435} from "./tools.js" ;
3536import { PrefStorage } from "./pref_storage.js" ;
3637import { makeScreenshot } from "./screenshot.js" ;
@@ -1729,6 +1730,12 @@ function BlackboxLogViewer() {
17291730 $ ( ".btn-video-export" ) . click ( function ( e ) {
17301731 setGraphState ( GRAPH_STATE_PAUSED ) ;
17311732
1733+ // Video export is only supported in Chromium based browsers
1734+ if ( ! isChromium ( ) ) {
1735+ alert ( "Video export is only supported in Chromium based browsers." ) ;
1736+ return ;
1737+ }
1738+
17321739 const exportDialog = new VideoExportDialog ( $ ( "#dlgVideoExport" ) , function ( newConfig ) {
17331740 videoConfig = newConfig ;
17341741
Original file line number Diff line number Diff line change @@ -484,3 +484,17 @@ export function getManifestVersion(manifest) {
484484export function escapeRegExp ( string ) {
485485 return string . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
486486}
487+
488+ export function isChromium ( ) {
489+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent
490+ if ( ! navigator . userAgentData ) {
491+ console . log ( navigator . userAgent ) ;
492+ return false ;
493+ }
494+
495+ console . log ( navigator . userAgentData ) ;
496+ // https://learn.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance
497+ return navigator . userAgentData . brands . some ( ( brand ) => {
498+ return brand . brand == "Chromium" ;
499+ } ) ;
500+ }
You can’t perform that action at this time.
0 commit comments