@@ -310,7 +310,7 @@ const renderJsLanguageInfo = (jsLanguageInfo) => {
310310 const langTitleP = document . createElement ( "p" ) ;
311311 langTitleP . className = "mb-1" ;
312312 const strongLang = document . createElement ( "strong" ) ;
313- strongLang . textContent = "navigator.language:" ;
313+ strongLang . textContent = translateDetect ( "navigator_language_label" ) ;
314314 langTitleP . appendChild ( strongLang ) ;
315315 fragment . appendChild ( langTitleP ) ;
316316
@@ -322,7 +322,7 @@ const renderJsLanguageInfo = (jsLanguageInfo) => {
322322 const langsTitleP = document . createElement ( "p" ) ;
323323 langsTitleP . className = "mb-1 mt-2" ;
324324 const strongLangs = document . createElement ( "strong" ) ;
325- strongLangs . textContent = "navigator.languages:" ;
325+ strongLangs . textContent = translateDetect ( "navigator_languages_label" ) ;
326326 langsTitleP . appendChild ( strongLangs ) ;
327327 fragment . appendChild ( langsTitleP ) ;
328328
@@ -393,7 +393,7 @@ const renderCanvasFingerprintInfo = (canvasFingerprintInfo) => {
393393 const hashTitleP = document . createElement ( "p" ) ;
394394 hashTitleP . className = "mb-1" ;
395395 const strongHash = document . createElement ( "strong" ) ;
396- strongHash . textContent = "Canvas hash:" ;
396+ strongHash . textContent = translateDetect ( "canvas_hash_label" ) ;
397397 hashTitleP . appendChild ( strongHash ) ;
398398 fragment . appendChild ( hashTitleP ) ;
399399
@@ -501,12 +501,18 @@ const renderWebglFingerprintInfo = (webglFingerprintInfo) => {
501501 fragment . appendChild ( valP ) ;
502502 } ;
503503
504- addDetail ( "WebGL hash:" , webglFingerprintInfo . hash , true , "" ) ;
505- addDetail ( "WebGL unmasked vendor:" , webglFingerprintInfo . vendor ) ;
506- addDetail ( "WebGL unmasked renderer:" , webglFingerprintInfo . renderer ) ;
507- addDetail ( "WebGL version:" , webglFingerprintInfo . version ) ;
504+ addDetail ( translateDetect ( "webgl_hash_label" ) , webglFingerprintInfo . hash , true , "" ) ;
508505 addDetail (
509- "Shading Language Version:" ,
506+ translateDetect ( "webgl_unmasked_vendor_label" ) ,
507+ webglFingerprintInfo . vendor ,
508+ ) ;
509+ addDetail (
510+ translateDetect ( "webgl_unmasked_renderer_label" ) ,
511+ webglFingerprintInfo . renderer ,
512+ ) ;
513+ addDetail ( translateDetect ( "webgl_version_label" ) , webglFingerprintInfo . version ) ;
514+ addDetail (
515+ translateDetect ( "webgl_shading_language_version_label" ) ,
510516 webglFingerprintInfo . shadingLanguageVersion ,
511517 ) ;
512518
@@ -599,7 +605,7 @@ const renderAudioFingerprintInfo = (audioFingerprintInfo) => {
599605 const hashTitleP = document . createElement ( "p" ) ;
600606 hashTitleP . className = "mb-1" ;
601607 const strongHash = document . createElement ( "strong" ) ;
602- strongHash . textContent = "AudioContext hash:" ;
608+ strongHash . textContent = translateDetect ( "audio_context_hash_label" ) ;
603609 hashTitleP . appendChild ( strongHash ) ;
604610 fragment . appendChild ( hashTitleP ) ;
605611
@@ -656,7 +662,7 @@ const renderIntlInfo = (intlInfo) => {
656662 const dtTitleP = document . createElement ( "p" ) ;
657663 dtTitleP . className = "mb-1" ;
658664 const strongDt = document . createElement ( "strong" ) ;
659- strongDt . textContent = "DateTimeFormat Locale:" ;
665+ strongDt . textContent = translateDetect ( "datetime_format_locale_label" ) ;
660666 dtTitleP . appendChild ( strongDt ) ;
661667 fragment . appendChild ( dtTitleP ) ;
662668
@@ -668,7 +674,7 @@ const renderIntlInfo = (intlInfo) => {
668674 const nfTitleP = document . createElement ( "p" ) ;
669675 nfTitleP . className = "mb-1 mt-2" ;
670676 const strongNf = document . createElement ( "strong" ) ;
671- strongNf . textContent = "NumberFormat Locale:" ;
677+ strongNf . textContent = translateDetect ( "number_format_locale_label" ) ;
672678 nfTitleP . appendChild ( strongNf ) ;
673679 fragment . appendChild ( nfTitleP ) ;
674680
@@ -693,7 +699,23 @@ const collectWebRtcIps = async () =>
693699 const ips = [ ] ;
694700
695701 try {
702+ if ( typeof ResourceManager . createRTCPeerConnection !== "function" ) {
703+ resolve ( {
704+ unsupported : true ,
705+ error : translateDetect ( "webrtc_not_supported" ) ,
706+ } ) ;
707+ return ;
708+ }
709+
696710 const pc = ResourceManager . createRTCPeerConnection ( { iceServers : [ ] } ) ;
711+ if ( ! pc ) {
712+ resolve ( {
713+ unsupported : true ,
714+ error : translateDetect ( "webrtc_not_supported" ) ,
715+ } ) ;
716+ return ;
717+ }
718+
697719 pc . createDataChannel ( "" ) ;
698720
699721 pc . onicecandidate = ( event ) => {
@@ -719,17 +741,30 @@ const collectWebRtcIps = async () =>
719741
720742 ResourceManager . setTimeout ( ( ) => {
721743 ResourceManager . closeRTCPeerConnection ( pc ) ;
722- resolve ( ips ) ;
744+ resolve ( { ips, unsupported : false , error : "" } ) ;
723745 } , 1000 ) ;
724746 } catch ( error ) {
725747 console . error ( "WebRTC collection error:" , error ) ;
726- resolve ( [ ] ) ;
748+ resolve ( {
749+ unsupported : true ,
750+ error : error ?. message || String ( error ) ,
751+ } ) ;
727752 }
728753 } ) ;
729754
730755const collectWebRtcInfo = async ( ) => {
731756 try {
732- const ips = await collectWebRtcIps ( ) ;
757+ const result = await collectWebRtcIps ( ) ;
758+ if ( result ?. unsupported ) {
759+ return {
760+ status : "unsupported" ,
761+ ips : [ ] ,
762+ ipLeakDetected : false ,
763+ error : result . error || translateDetect ( "webrtc_not_supported" ) ,
764+ } ;
765+ }
766+
767+ const ips = result ?. ips || [ ] ;
733768 return {
734769 status : ips . length > 0 ? "ok" : "none" ,
735770 ips,
@@ -754,7 +789,7 @@ const renderWebRtcInfo = (webRtcInfo) => {
754789 webRtcInfoElement . innerHTML = "" ;
755790 const fragment = document . createDocumentFragment ( ) ;
756791
757- if ( webRtcInfo . status === "error" ) {
792+ if ( webRtcInfo . status === "error" || webRtcInfo . status === "unsupported" ) {
758793 const errorP = document . createElement ( "p" ) ;
759794 errorP . className = "text-danger" ;
760795 errorP . textContent = `${ translateDetect ( "webrtc_not_supported" ) } : ${ webRtcInfo . error } ` ;
@@ -865,15 +900,15 @@ const renderFingerprintInfo = (fingerprintInfo) => {
865900 fragment . appendChild ( valP ) ;
866901 } ;
867902
868- addDetail ( "User Agent:" , fingerprintInfo . userAgent , false , "" , true ) ;
903+ addDetail ( translateDetect ( "user_agent_label" ) , fingerprintInfo . userAgent , false , "" , true ) ;
869904 addDetail (
870- "Screen information:" ,
905+ translateDetect ( "screen_information_label" ) ,
871906 `${ fingerprintInfo . screen . width } x${ fingerprintInfo . screen . height } x${ fingerprintInfo . screen . colorDepth } ` ,
872907 true ,
873908 ) ;
874909 addDetail (
875- "Timezone:" ,
876- `${ fingerprintInfo . timezone } (Offset: ${ fingerprintInfo . timezoneOffset } )` ,
910+ translateDetect ( "timezone_label" ) ,
911+ `${ fingerprintInfo . timezone } (${ translateDetect ( "offset_label" ) } ${ fingerprintInfo . timezoneOffset } )` ,
877912 true ,
878913 ) ;
879914
@@ -896,7 +931,7 @@ const renderCompatibilityInfo = (compatibilityInfo) => {
896931 const apiListEl = document . getElementById ( "apiCompatibilityList" ) ;
897932 if ( ! browserInfoEl || ! apiListEl ) return ;
898933
899- browserInfoEl . textContent = `${ compatibilityInfo . browser . name } ${ compatibilityInfo . browser . fullVersion } on ${ compatibilityInfo . browser . os } ` ;
934+ browserInfoEl . textContent = `${ compatibilityInfo . browser . name } ${ compatibilityInfo . browser . fullVersion } ${ translateDetect ( "on_connector" ) } ${ compatibilityInfo . browser . os } ` ;
900935 apiListEl . innerHTML = "" ;
901936
902937 compatibilityInfo . apiSupport . forEach ( ( api ) => {
0 commit comments