From 66f4e4687676cb0b5a3fef248b9e8544816e32c4 Mon Sep 17 00:00:00 2001 From: kudo-sync-bot Date: Thu, 14 Nov 2024 02:35:32 -0800 Subject: [PATCH] =?UTF-8?q?Shortened=20regex=20=E2=86=9E=20[auto-sync=20fr?= =?UTF-8?q?om=20`adamlui/ai-web-extensions/googlegpt`]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatgpt/googlegpt/googlegpt.user.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chatgpt/googlegpt/googlegpt.user.js b/chatgpt/googlegpt/googlegpt.user.js index 010f58b35..b89ebb0c5 100644 --- a/chatgpt/googlegpt/googlegpt.user.js +++ b/chatgpt/googlegpt/googlegpt.user.js @@ -149,7 +149,7 @@ // @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!) // @author KudoAI // @namespace https://kudoai.com -// @version 2024.11.14 +// @version 2024.11.14.1 // @license MIT // @icon https://media.googlegpt.io/images/icons/googlegpt/black/icon48.png?8652a6e // @icon64 https://media.googlegpt.io/images/icons/googlegpt/black/icon64.png?8652a6e @@ -429,7 +429,7 @@ } app.urls.assetHost = app.urls.gitHub.replace('github.com', 'cdn.jsdelivr.net/gh') + `@${app.latestAssetCommitHash}` app.urls.update = app.urls.greasyFork.replace('https://', 'https://update.') - .replace(/(\d+)-?([a-zA-Z-]*)$/, (_, id, name) => `${id}/${ name || 'script' }.meta.js`) + .replace(/(\d+)-?([a-z-]*)$/i, (_, id, name) => `${id}/${ name || 'script' }.meta.js`) // Init ENV info const env = { browser: {}, scriptManager: (() => { try { return GM_info.scriptHandler } catch (err) { return 'unknown' }})() }; @@ -464,11 +464,11 @@ regEx: { greenVals: { caseInsensitive: /\b(?:true|\d+)\b|success\W?/i, caseSensitive: /\bON\b/ }, - redVals: { caseInsensitive: /\b(?:false)\b|error\W?/i, caseSensitive: /\BOFF\b/ }, - purpVals: /[ '"]\w+['"]?: /i }, + redVals: { caseInsensitive: /\bfalse\b|error\W?/i, caseSensitive: /\BOFF\b/ }, + purpVals: /[ '"]\w+['"]?: / }, prettifyObj(obj) { return JSON.stringify(obj) - .replace(/([{,](?=")|(?:"):)/g, '$1 ') // append spaces to { and " + .replace(/([{,](?=")|":)/g, '$1 ') // append spaces to { and " .replace(/((? match[1] .replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n')) - .filter(match => !/(?:message_(?:start|end)|done)/.test(match)) + .filter(match => !/message_(?:start|end)|done/.test(match)) chunk = extractedChunks.join('') } accumulatedChunks = apis[caller.api].accumulatesText ? chunk : accumulatedChunks + chunk @@ -3480,7 +3480,7 @@ try { // to show response or return related queries const extractedData = Array.from(resp.responseText.matchAll(/data:(.*)/g), match => match[1] .replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n')) - .filter(match => !/(?:message_(?:start|end)|done)/.test(match)) + .filter(match => !/message_(?:start|end)|done/.test(match)) respText = extractedData.join('') ; handleProcessCompletion() } catch (err) { handleProcessError(err) } }