Skip to content

Commit 9065e91

Browse files
committed
Renamed msgXHRtries to msgFetchesTried ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/amazongpt]
1 parent 5b93bb7 commit 9065e91

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2026.1.27.1
6+
// @version 2026.2.5
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -166,7 +166,7 @@
166166
msgs: await new Promise(resolve => {
167167
const msgHostDir = `${app.urls.resourceHost}/greasemonkey/_locales/`,
168168
msgLocaleDir = `${ env.browser.language ? env.browser.language.replace('-', '_') : 'en' }/`
169-
let msgHref = `${ msgHostDir + msgLocaleDir }messages.json`, msgXHRtries = 0
169+
let msgHref = `${ msgHostDir + msgLocaleDir }messages.json`, msgFetchesTried = 0
170170
function fetchMsgs() { xhr({ method: 'GET', url: msgHref, onload: handleMsgs })}
171171
function handleMsgs(resp) {
172172
try { // to return localized messages.json
@@ -176,8 +176,8 @@
176176
flatMsgs[key] = msgs[key].message
177177
resolve(flatMsgs)
178178
} catch (err) { // if bad response
179-
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
180-
msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
179+
msgFetchesTried++ ; if (msgFetchesTried == 3) return resolve({}) // try original/region-stripped/EN only
180+
msgHref = env.browser.language.includes('-') && msgFetchesTried == 1 ? // if regional lang on 1st try...
181181
msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying
182182
: `${msgHostDir}en/messages.json` // else use default English messages
183183
fetchMsgs()

0 commit comments

Comments
 (0)