|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
|
149 | 149 | // @author KudoAI
|
150 | 150 | // @namespace https://kudoai.com
|
151 |
| -// @version 2025.1.15.6 |
| 151 | +// @version 2025.1.15.7 |
152 | 152 | // @license MIT
|
153 | 153 | // @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
|
154 | 154 | // @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
|
|
230 | 230 | version: (() => { try { return GM_info.version } catch (err) { return 'unknown' }})()
|
231 | 231 | }
|
232 | 232 | };
|
233 |
| - ['Chrome', 'Firefox', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
| 233 | + ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
234 | 234 | env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
|
235 | 235 | env.browser.isPortrait = env.browser.isMobile && (window.innerWidth < window.innerHeight)
|
236 | 236 | env.browser.isPhone = env.browser.isMobile && window.innerWidth <= 480
|
|
3409 | 3409 | // Handle stream done
|
3410 | 3410 | let chunk = new TextDecoder('utf8').decode(new Uint8Array(value))
|
3411 | 3411 | if (done || chunk.includes(apis[caller.api].watermark)) return handleProcessCompletion()
|
3412 |
| - this.timeout = setTimeout(handleProcessCompletion, 500) // since reader.read() doesn't signal done in Chromium |
| 3412 | + if (env.browser.isChromium) { // clear/add timeout since reader.read() doesn't signal done |
| 3413 | + clearTimeout(this.timeout) ; this.timeout = setTimeout(handleProcessCompletion, 500) } |
3413 | 3414 |
|
3414 | 3415 | // Process/show chunk
|
3415 | 3416 | if (caller.api == 'MixerBox AI') { // pre-process chunks
|
|
3448 | 3449 | }
|
3449 | 3450 |
|
3450 | 3451 | function handleProcessCompletion() {
|
3451 |
| - caller.sender = this.timeout = null |
| 3452 | + caller.sender = null ; if (env.browser.isChromium) clearTimeout(this.timeout) |
3452 | 3453 | if (appDiv.querySelector('.loading')) // no text shown
|
3453 | 3454 | api.tryNew(caller)
|
3454 | 3455 | else { // text was shown
|
|
0 commit comments