Skip to content

Commit c15ba53

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chatgpt/chatgpt-auto-continue/chatgpt-auto-continue.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
// @description:zu ⚡ Terus menghasilkan imibuzo eminingi ye-ChatGPT ngokwesizulu
220220
// @author Adam Lui
221221
// @namespace https://github.com/adamlui
222-
// @version 2025.3.22.3
222+
// @version 2025.3.23
223223
// @license MIT
224224
// @icon https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@a8c9387/assets/images/icons/continue-symbol/black/icon48.png
225225
// @icon64 https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@a8c9387/assets/images/icons/continue-symbol/black/icon64.png
@@ -348,7 +348,7 @@
348348
} catch (err) { // if bad response
349349
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
350350
msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
351-
msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying
351+
msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying
352352
: ( msgHostDir + 'en/messages.json' ) // else use default English messages
353353
fetchMsgs()
354354
}

0 commit comments

Comments
 (0)