|
149 | 149 | // @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
|
150 | 150 | // @author KudoAI
|
151 | 151 | // @namespace https://kudoai.com
|
152 |
| -// @version 2025.3.22.1 |
| 152 | +// @version 2025.3.23 |
153 | 153 | // @license MIT
|
154 | 154 | // @icon https://cdn.jsdelivr.net/gh/KudoAI/googlegpt@59409b2/assets/images/icons/googlegpt/black/icon48.png
|
155 | 155 | // @icon64 https://cdn.jsdelivr.net/gh/KudoAI/googlegpt@59409b2/assets/images/icons/googlegpt/black/icon64.png
|
|
694 | 694 | } catch (err) { // if bad response
|
695 | 695 | msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
|
696 | 696 | msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
|
697 |
| - msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying |
| 697 | + msgHref.replace(/(_locales\/[^_]+)_[^_]+(\/)/, '$1$2') // ...strip region before retrying |
698 | 698 | : ( msgHostDir + 'en/messages.json' ) // else use default English messages
|
699 | 699 | fetchMsgs()
|
700 | 700 | }
|
|
1364 | 1364 | else if (key.includes('rq')) toggle.relatedQueries()
|
1365 | 1365 | else if (autoGenMatch) toggle.autoGen(autoGenMatch[0].toLowerCase())
|
1366 | 1366 | else if (manualGenMatch) toggle.manualGen(manualGenMatch[0].toLowerCase())
|
1367 |
| - else if (key.includes('Sidebar')) toggle.sidebar(/(.*?)Sidebar$/.exec(key)[1]) |
| 1367 | + else if (key.includes('Sidebar')) toggle.sidebar(key.replace('Sidebar', '')) |
1368 | 1368 | else if (key.includes('anchor')) toggle.anchorMode()
|
1369 | 1369 | else if (key.includes('bgAnimation')) toggle.animations('bg')
|
1370 | 1370 | else if (key.includes('fgAnimation')) toggle.animations('fg')
|
|
1493 | 1493 | const html = resp.responseText, dlLink = document.createElement('a')
|
1494 | 1494 | dlLink.href = URL.createObjectURL(new Blob([html], { type: 'text/html' }))
|
1495 | 1495 | dlLink.download /* filename */ = html.match(/<title>([^<]+)<\/title>/i)[1] // page title
|
1496 |
| - .replace(/\s+[—|/]+\s+/g, ' ') // convert suffix sep to space for hyphen-casing |
| 1496 | + .replace(/\s*[—|/]+\s*/g, ' ') // convert symbols to space for hyphen-casing |
1497 | 1497 | .toLowerCase().trim().replace(/\s+/g, '-') // hyphen-case
|
1498 | 1498 | + '.html'
|
1499 | 1499 | document.body.append(dlLink) ; dlLink.click() ; dlLink.remove() // download HTML
|
|
4479 | 4479 | const msgChain = [], searchQuery = new URL(location.href).searchParams.get('q')
|
4480 | 4480 | if (config.autoGet || config.autoSummarize // Auto-Gen on
|
4481 | 4481 | || (config.prefixEnabled || config.suffixEnabled) // or Manual-Gen on
|
4482 |
| - && [config.prefixEnabled && /.*q=%2F/.test(location.href), // prefix required/present |
| 4482 | + && [config.prefixEnabled && location.href.includes('q=%2F'), // prefix required/present |
4483 | 4483 | config.suffixEnabled // suffix required/present
|
4484 |
| - && /.*q=.*(?:%3F|?|%EF%BC%9F)(?:&|$)/.test(location.href) |
| 4484 | + && /q=.*?(?:%3F|?|%EF%BC%9F)(?:&|$)/.test(location.href) |
4485 | 4485 | ].filter(Boolean).length == (config.prefixEnabled + config.suffixEnabled) // validate both Manual-Gen modes
|
4486 | 4486 | ) { // auto-gen reply
|
4487 | 4487 | msgChain.push({
|
|
0 commit comments