From c1f467e65e0a59e86536da7210ead2fdd3a4b983 Mon Sep 17 00:00:00 2001 From: kudo-sync-bot Date: Wed, 20 Nov 2024 07:12:23 -0800 Subject: [PATCH] =?UTF-8?q?Improved=20readability=20of=20`streamingSupport?= =?UTF-8?q?ed`=20key=20names=20=E2=86=9E=20[auto-sync=20from=20https://git?= =?UTF-8?q?hub.com/adamlui/ai-web-extensions]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- greasemonkey/duckduckgpt.user.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/greasemonkey/duckduckgpt.user.js b/greasemonkey/duckduckgpt.user.js index 4d048f41980..0033e5f7943 100644 --- a/greasemonkey/duckduckgpt.user.js +++ b/greasemonkey/duckduckgpt.user.js @@ -148,7 +148,7 @@ // @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!) // @author KudoAI // @namespace https://kudoai.com -// @version 2024.11.20.3 +// @version 2024.11.20.4 // @license MIT // @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302 // @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302 @@ -334,8 +334,8 @@ // Init COMPATIBILITY flags log.debug('Initializing compatibility flags...') const streamingSupported = { - browser: !(env.scriptManager.name == 'Tampermonkey' && (env.browser.isChrome || env.browser.isEdge || env.browser.isBrave)), - scriptManager: /Tampermonkey|ScriptCat/.test(env.scriptManager.name) } + byBrowser: !(env.scriptManager.name == 'Tampermonkey' && (env.browser.isChrome || env.browser.isEdge || env.browser.isBrave)), + byScriptManager: /Tampermonkey|ScriptCat/.test(env.scriptManager.name) } log.debug(`Success! streamingSupported = ${log.prettifyObj(streamingSupported)}`) // Init CONFIG @@ -347,7 +347,7 @@ 'replyLanguage', 'rqDisabled', 'scheme', 'stickySidebar', 'streamingDisabled', 'suffixEnabled', 'widerSidebar') if (!config.replyLanguage) settings.save('replyLanguage', config.userLanguage) // init reply language if unset if (!config.fontSize) settings.save('fontSize', 14) // init reply font size if unset - if (!streamingSupported.browser || !streamingSupported.scriptManager) settings.save('streamingDisabled', true) // disable Streaming in unspported env + if (!streamingSupported.byBrowser || !streamingSupported.byScriptManager) settings.save('streamingDisabled', true) // disable Streaming in unspported env if (!config.notFirstRun && env.browser.isMobile) settings.save('autoGet', true) // reverse default auto-get disabled if mobile settings.save('notFirstRun', true) log.debug(`Success! config = ${log.prettifyObj(config)}`) @@ -1217,7 +1217,7 @@ // Add click listener settingItem.onclick = () => { if (!(key == 'streamingDisabled' // visually switch toggle if not Streaminng... - && (!streamingSupported.browser || !streamingSupported.scriptManager // ...in unsupported env... + && (!streamingSupported.byBrowser || !streamingSupported.byScriptManager // ...in unsupported env... || !config.proxyAPIenabled) // ...or in OpenAI mode )) modals.settings.toggle.switch(settingToggle) @@ -2706,7 +2706,7 @@ const scriptCatLink = env.browser.isFF ? 'https://addons.mozilla.org/firefox/addon/scriptcat/' : env.browser.isEdge ? 'https://microsoftedge.microsoft.com/addons/detail/scriptcat/liilgpjgabokdklappibcjfablkpcekh' : 'https://chromewebstore.google.com/detail/scriptcat/ndcooeababalnlpkfedmmbbbgkljhpjf' - if (!streamingSupported.scriptManager) { // alert userscript manager unsupported, suggest TM/SC + if (!streamingSupported.byScriptManager) { // alert userscript manager unsupported, suggest TM/SC log.debug(`Streaming Mode unsupported in ${env.scriptManager.name}`) const suggestAlertID = siteAlert(`${settings.controls.streamingDisabled.label} ${app.msgs.alert_unavailable}`, `${settings.controls.streamingDisabled.label} ${app.msgs.alert_isOnlyAvailFor}` @@ -2718,7 +2718,7 @@ ) const suggestAlert = document.getElementById(suggestAlertID).firstChild modals.init(suggestAlert) // add classes/stars, disable wheel-scrolling, dim bg, glowup btns - } else if (!streamingSupported.browser) { // alert TM/browser unsupported, suggest SC + } else if (!streamingSupported.byBrowser) { // alert TM/browser unsupported, suggest SC log.debug('Streaming Mode unsupported in browser') const suggestAlertID = siteAlert(`${settings.controls.streamingDisabled.label} ${app.msgs.alert_unavailable}`, `${settings.controls.streamingDisabled.label} ${app.msgs.alert_isUnsupportedIn} `