|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
|
149 | 149 | // @author KudoAI
|
150 | 150 | // @namespace https://kudoai.com
|
151 |
| -// @version 2025.3.22.1 |
| 151 | +// @version 2025.3.23 |
152 | 152 | // @license MIT
|
153 | 153 | // @icon https://cdn.jsdelivr.net/gh/KudoAI/bravegpt@df624b0/assets/images/icons/bravegpt/icon48.png
|
154 | 154 | // @icon64 https://cdn.jsdelivr.net/gh/KudoAI/bravegpt@df624b0/assets/images/icons/bravegpt/icon64.png
|
|
511 | 511 | } catch (err) { // if bad response
|
512 | 512 | msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
|
513 | 513 | msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
|
514 |
| - msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying |
| 514 | + msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying |
515 | 515 | : ( msgHostDir + 'en/messages.json' ) // else use default English messages
|
516 | 516 | fetchMsgs()
|
517 | 517 | }
|
|
1219 | 1219 | else if (key.includes('rq')) toggle.relatedQueries()
|
1220 | 1220 | else if (autoGenMatch) toggle.autoGen(autoGenMatch[0].toLowerCase())
|
1221 | 1221 | else if (manualGenMatch) toggle.manualGen(manualGenMatch[0].toLowerCase())
|
1222 |
| - else if (key.includes('Sidebar')) toggle.sidebar(/(.*?)Sidebar$/.exec(key)[1]) |
| 1222 | + else if (key.includes('Sidebar')) toggle.sidebar(key.replace('Sidebar', '')) |
1223 | 1223 | else if (key.includes('anchor')) toggle.anchorMode()
|
1224 | 1224 | else if (key.includes('bgAnimation')) toggle.animations('bg')
|
1225 | 1225 | else if (key.includes('fgAnimation')) toggle.animations('fg')
|
|
1349 | 1349 | const html = resp.responseText, dlLink = document.createElement('a')
|
1350 | 1350 | dlLink.href = URL.createObjectURL(new Blob([html], { type: 'text/html' }))
|
1351 | 1351 | dlLink.download /* filename */ = html.match(/<title>([^<]+)<\/title>/i)[1] // page title
|
1352 |
| - .replace(/\s+[—|/]+\s+/g, ' ') // convert suffix sep to space for hyphen-casing |
| 1352 | + .replace(/\s*[—|/]+\s*/g, ' ') // convert symbols to space for hyphen-casing |
1353 | 1353 | .toLowerCase().trim().replace(/\s+/g, '-') // hyphen-case
|
1354 | 1354 | + '.html'
|
1355 | 1355 | document.body.append(dlLink) ; dlLink.click() ; dlLink.remove() // download HTML
|
|
4266 | 4266 | const msgChain = [], searchQuery = new URL(location.href).searchParams.get('q')
|
4267 | 4267 | if (!config.autoGetDisabled || config.autoSummarize // Auto-Gen on
|
4268 | 4268 | || (config.prefixEnabled || config.suffixEnabled) // or Manual-Gen on
|
4269 |
| - && [config.prefixEnabled && /.*q=%2F/.test(location.href), // prefix required/present |
| 4269 | + && [config.prefixEnabled && location.href.includes('q=%2F'), // prefix required/present |
4270 | 4270 | config.suffixEnabled // suffix required/present
|
4271 |
| - && /.*q=.*(?:%3F|?|%EF%BC%9F)(?:&|$)/.test(location.href) |
| 4271 | + && /q=.*?(?:%3F|?|%EF%BC%9F)(?:&|$)/.test(location.href) |
4272 | 4272 | ].filter(Boolean).length == (config.prefixEnabled + config.suffixEnabled) // validate both Manual-Gen modes
|
4273 | 4273 | ) { // auto-gen reply
|
4274 | 4274 | msgChain.push({
|
|
0 commit comments