Skip to content

Commit 28af55b

Browse files
committed
Reduced/eliminated backtracking in regex ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-refresh]
1 parent 2878282 commit 28af55b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
221221
// @author Adam Lui
222222
// @namespace https://github.com/adamlui
223-
// @version 2025.3.22.3
223+
// @version 2025.3.23
224224
// @license MIT
225225
// @icon https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-refresh@f11a0a8/assets/images/icons/openai/black/icon48.png
226226
// @icon64 https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-refresh@f11a0a8/assets/images/icons/openai/black/icon64.png
@@ -373,7 +373,7 @@
373373
} catch (err) { // if bad response
374374
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
375375
msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
376-
msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying
376+
msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying
377377
: ( msgHostDir + 'en/messages.json' ) // else use default English messages
378378
fetchMsgs()
379379
}

0 commit comments

Comments
 (0)