Skip to content

Commit 912b56d

Browse files
committed
Merge remote-tracking branch 'refs/remotes/gitdedalo/v6_developer' into v6_developer
2 parents 4c8e410 + f8ee59c commit 912b56d

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

tools/tool_transcription/js/render_tool_transcription.js

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66

77
// 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'
1516

1617

1718

@@ -779,30 +780,10 @@ const render_automatic_transcription = function (options) {
779780
const button_automatic_transcription_click_handler = async function(e){
780781
e.stopPropagation()
781782

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?")) {
806787
return false
807788
}
808789
}

0 commit comments

Comments
 (0)