|
3 | 3 | // @description Adds the magic of AI to Amazon shopping
|
4 | 4 | // @author KudoAI
|
5 | 5 | // @namespace https://kudoai.com
|
6 |
| -// @version 2025.1.15.5 |
| 6 | +// @version 2025.1.15.6 |
7 | 7 | // @license MIT
|
8 | 8 | // @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
|
9 | 9 | // @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
|
|
106 | 106 | version: (() => { try { return GM_info.version } catch (err) { return 'unknown' }})()
|
107 | 107 | }
|
108 | 108 | };
|
109 |
| - ['Chrome', 'Firefox', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
| 109 | + ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
110 | 110 | env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
|
111 | 111 | env.browser.isPortrait = env.browser.isMobile && (window.innerWidth < window.innerHeight)
|
112 | 112 | env.browser.isPhone = env.browser.isMobile && window.innerWidth <= 480
|
|
2687 | 2687 | // Handle stream done
|
2688 | 2688 | let chunk = new TextDecoder('utf8').decode(new Uint8Array(value))
|
2689 | 2689 | if (done || chunk.includes(apis[caller.api].watermark)) return handleProcessCompletion()
|
2690 |
| - this.timeout = setTimeout(handleProcessCompletion, 500) // since reader.read() doesn't signal done in Chromium |
| 2690 | + if (env.browser.isChromium) { // clear/add timeout since reader.read() doesn't signal done |
| 2691 | + clearTimeout(this.timeout) ; this.timeout = setTimeout(handleProcessCompletion, 500) } |
2691 | 2692 |
|
2692 | 2693 | // Process/show chunk
|
2693 | 2694 | if (caller.api == 'MixerBox AI') { // pre-process chunks
|
|
2726 | 2727 | }
|
2727 | 2728 |
|
2728 | 2729 | function handleProcessCompletion() {
|
2729 |
| - caller.sender = this.timeout = null |
| 2730 | + caller.sender = null ; if (env.browser.isChromium) clearTimeout(this.timeout) |
2730 | 2731 | if (appDiv.querySelector('.loading')) // no text shown
|
2731 | 2732 | api.tryNew(caller)
|
2732 | 2733 | else { // text was shown
|
|
0 commit comments