|
5 | 5 |
|
6 | 6 |
|
7 | 7 | // imports |
8 | | - import {event_manager} from '../../../core/common/js/event_manager.js' |
9 | | - import {data_manager} from '../../../core/common/js/data_manager.js' |
10 | | - import {ui} from '../../../core/common/js/ui.js' |
11 | | - import {keyboard_codes} from '../../../core/common/js/utils/keyboard.js' |
12 | | - import {render_node_info} from '../../../core/common/js/utils/notifications.js' |
13 | | - import {open_tool} from '../../tool_common/js/tool_common.js' |
14 | | - import {get_current_lang_info} from './tool_transcription.js' |
| 8 | + import { event_manager } from '../../../core/common/js/event_manager.js' |
| 9 | + import { data_manager } from '../../../core/common/js/data_manager.js' |
| 10 | + import { ui } from '../../../core/common/js/ui.js' |
| 11 | + import { ua } from '../../../core/common/js/ua.js' |
| 12 | + import { keyboard_codes } from '../../../core/common/js/utils/keyboard.js' |
| 13 | + import { render_node_info } from '../../../core/common/js/utils/notifications.js' |
| 14 | + import { open_tool } from '../../tool_common/js/tool_common.js' |
| 15 | + import { get_current_lang_info } from './tool_transcription.js' |
15 | 16 |
|
16 | 17 |
|
17 | 18 |
|
@@ -779,30 +780,10 @@ const render_automatic_transcription = function (options) { |
779 | 780 | const button_automatic_transcription_click_handler = async function(e){ |
780 | 781 | e.stopPropagation() |
781 | 782 |
|
782 | | - // check for browser requirements. This check allows Edge (Chromium) too |
783 | | - const is_chrome137_or_higher = () => { |
784 | | - if (navigator.userAgentData) { |
785 | | - const brands = navigator.userAgentData.brands; |
786 | | - const chromeBrand = brands.find(b => b.brand === "Google Chrome" || b.brand === "Chromium"); |
787 | | - |
788 | | - if (chromeBrand) { |
789 | | - const version = parseInt(chromeBrand.version, 10); |
790 | | - return version >= 137; |
791 | | - } |
792 | | - } |
793 | | - |
794 | | - // Fallback to userAgent |
795 | | - const ua = navigator.userAgent; |
796 | | - const match = ua.match(/Chrome\/(\d+)/i); |
797 | | - if (match && match[1]) { |
798 | | - const version = parseInt(match[1], 10); |
799 | | - return version >= 137; |
800 | | - } |
801 | | - |
802 | | - return false; |
803 | | - } |
804 | | - if (!is_chrome137_or_higher()) { |
805 | | - if(!confirm("This feature requires Chrome version 136 or newer. Continue?")) { |
| 783 | + // Check the user agent can perform correctly and using webGPU |
| 784 | + const is_a_valid_user_agent = await ua.check_transformers_webgpu() |
| 785 | + if (!is_a_valid_user_agent.overall) { |
| 786 | + if(!confirm("For optimal performance, use a webGPU-compatible browser. Your current browser may run this task very slowly. Continue?")) { |
806 | 787 | return false |
807 | 788 | } |
808 | 789 | } |
|
0 commit comments