Skip to content

Commit 3a7ed18

Browse files
committed
Renamed msgXHRtries to msgFetchesTried ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
1 parent 9cb6880 commit 3a7ed18

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2026.1.27.3
151+
// @version 2026.2.5
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f
154154
// @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f
@@ -292,7 +292,7 @@
292292
msgs: await new Promise(resolve => {
293293
const msgHostDir = `${app.urls.resourceHost}/greasemonkey/_locales/`,
294294
msgLocaleDir = `${ env.browser.language ? env.browser.language.replace('-', '_') : 'en' }/`
295-
let msgHref = `${ msgHostDir + msgLocaleDir }messages.json`, msgXHRtries = 0
295+
let msgHref = `${ msgHostDir + msgLocaleDir }messages.json`, msgFetchesTried = 0
296296
function fetchMsgs() { xhr({ method: 'GET', url: msgHref, onload: handleMsgs })}
297297
function handleMsgs(resp) {
298298
try { // to return localized messages.json
@@ -302,8 +302,8 @@
302302
flatMsgs[key] = msgs[key].message
303303
resolve(flatMsgs)
304304
} catch (err) { // if bad response
305-
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
306-
msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
305+
msgFetchesTried++ ; if (msgFetchesTried == 3) return resolve({}) // try original/region-stripped/EN only
306+
msgHref = env.browser.language.includes('-') && msgFetchesTried == 1 ? // if regional lang on 1st try...
307307
msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying
308308
: `${msgHostDir}en/messages.json` // else use default English messages
309309
fetchMsgs()

0 commit comments

Comments
 (0)