diff --git a/amazongpt/greasemonkey/amazongpt.user.js b/amazongpt/greasemonkey/amazongpt.user.js index 338115cc3..0bdcd6d53 100644 --- a/amazongpt/greasemonkey/amazongpt.user.js +++ b/amazongpt/greasemonkey/amazongpt.user.js @@ -3,7 +3,7 @@ // @description Adds the magic of AI to Amazon shopping // @author KudoAI // @namespace https://kudoai.com -// @version 2025.1.11 +// @version 2025.1.11.1 // @license MIT // @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7 // @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7 @@ -229,9 +229,15 @@ // Init DEBUG mode const config = {} const settings = { - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls?.[key]?.defaultVal || this.controls?.[key]?.type == 'toggle') + }) + }, save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } - } ; settings.load('debugMode') + } + settings.load('debugMode') // Define LOG props/functions const log = { @@ -346,23 +352,23 @@ // Init SETTINGS log.debug('Initializing settings...') - Object.assign(settings, { controls: { - proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', + Object.assign(settings, { controls: { // displays top-to-bottom, left-to-right in Settings modal + proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', defaultVal: false, label: app.msgs.menuLabel_proxyAPImode, helptip: app.msgs.helptip_proxyAPImode }, - streamingDisabled: { type: 'toggle', icon: 'signalStream', + streamingDisabled: { type: 'toggle', icon: 'signalStream', defaultVal: false, label: app.msgs.mode_streaming, helptip: app.msgs.helptip_streamingMode }, autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', label: app.msgs.menuLabel_autoFocusChatbar, helptip: app.msgs.helptip_autoFocusChatbar }, - autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', + autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', defaultVal: false, label: `${app.msgs.mode_autoScroll} (${app.msgs.menuLabel_whenStreaming})`, helptip: app.msgs.helptip_autoScroll }, - bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_background} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_bgAnimations }, - fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_foreground} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_fgAnimations }, replyLang: { type: 'prompt', icon: 'languageChars', @@ -371,7 +377,7 @@ scheme: { type: 'modal', icon: 'scheme', label: app.msgs.menuLabel_colorScheme, helptip: app.msgs.helptip_colorScheme }, - debugMode: { type: 'toggle', icon: 'bug', + debugMode: { type: 'toggle', icon: 'bug', defaultVal: false, label: app.msgs.mode_debug, helptip: app.msgs.helptip_debugMode }, about: { type: 'modal', icon: 'questionMarkCircle', diff --git a/autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js b/autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js index 81592b3d1..0bb9dcaf1 100644 --- a/autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js +++ b/autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js @@ -225,7 +225,7 @@ // @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com // @author Adam Lui // @namespace https://github.com/adamlui -// @version 2025.1.10.1 +// @version 2025.1.11 // @license MIT // @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06 // @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06 @@ -376,17 +376,23 @@ const settings = { controls: { // displays top-to-bottom in toolbar menu - autoclear: { type: 'toggle', + autoclear: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_autoclear, helptip: app.msgs.appDesc }, clearNow: { type: 'action', symbol: '🧹', label: app.msgs.menuLabel_clearNow, helptip: app.msgs.helptip_clearNow }, - toggleHidden: { type: 'toggle', + toggleHidden: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_toggleVis, helptip: app.msgs.helptip_toggleVis }, - notifDisabled: { type: 'toggle', + notifDisabled: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_modeNotifs, helptip: app.msgs.helptip_modeNotifs } }, - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) + }, + save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } } settings.load(Object.keys(settings.controls)) diff --git a/bravegpt/greasemonkey/bravegpt.user.js b/bravegpt/greasemonkey/bravegpt.user.js index d728de8a0..58d8c8e28 100644 --- a/bravegpt/greasemonkey/bravegpt.user.js +++ b/bravegpt/greasemonkey/bravegpt.user.js @@ -148,7 +148,7 @@ // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!) // @author KudoAI // @namespace https://kudoai.com -// @version 2025.1.10.1 +// @version 2025.1.11 // @license MIT // @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0 // @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0 @@ -385,9 +385,15 @@ // Init DEBUG mode const config = {} const settings = { - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls?.[key]?.defaultVal || this.controls?.[key]?.type == 'toggle') + }) + }, save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } - } ; settings.load('debugMode') + } + settings.load('debugMode') // Define LOG props/functions const log = { @@ -502,44 +508,44 @@ // Init SETTINGS log.debug('Initializing settings...') - Object.assign(settings, { controls: { - proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', + Object.assign(settings, { controls: { // displays top-to-bottom, left-to-right in Settings modal + proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', defaultVal: false, label: app.msgs.menuLabel_proxyAPImode, helptip: app.msgs.helptip_proxyAPImode }, - streamingDisabled: { type: 'toggle', icon: 'signalStream', + streamingDisabled: { type: 'toggle', icon: 'signalStream', defaultVal: false, label: app.msgs.mode_streaming, helptip: app.msgs.helptip_streamingMode }, - autoGetDisabled: { type: 'toggle', icon: 'speechBalloonLasso', + autoGetDisabled: { type: 'toggle', icon: 'speechBalloonLasso', defaultVal: false, label: app.msgs.menuLabel_autoGetAnswers, helptip: app.msgs.helptip_autoGetAnswers }, - autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', + autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', defaultVal: false, label: app.msgs.menuLabel_autoFocusChatbar, helptip: app.msgs.helptip_autoFocusChatbar }, - autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', + autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', defaultVal: false, label: `${app.msgs.mode_autoScroll} (${app.msgs.menuLabel_whenStreaming})`, helptip: app.msgs.helptip_autoScroll }, - rqDisabled: { type: 'toggle', icon: 'speechBalloons', + rqDisabled: { type: 'toggle', icon: 'speechBalloons', defaultVal: false, label: `${app.msgs.menuLabel_show} ${app.msgs.menuLabel_relatedQueries}`, helptip: app.msgs.helptip_showRelatedQueries }, - prefixEnabled: { type: 'toggle', icon: 'slash', + prefixEnabled: { type: 'toggle', icon: 'slash', defaultVal: false, label: `${app.msgs.menuLabel_require} "/" ${app.msgs.menuLabel_beforeQuery}`, helptip: app.msgs.helptip_prefixMode }, - suffixEnabled: { type: 'toggle', icon: 'questionMark', + suffixEnabled: { type: 'toggle', icon: 'questionMark', defaultVal: false, label: `${app.msgs.menuLabel_require} "?" ${app.msgs.menuLabel_afterQuery}`, helptip: app.msgs.helptip_suffixMode }, - widerSidebar: { type: 'toggle', mobile: false, icon: 'widescreen', + widerSidebar: { type: 'toggle', mobile: false, icon: 'widescreen', defaultVal: false, label: app.msgs.menuLabel_widerSidebar, helptip: app.msgs.helptip_widerSidebar }, - stickySidebar: { type: 'toggle', mobile: false, icon: 'webCorner', + stickySidebar: { type: 'toggle', mobile: false, icon: 'webCorner', defaultVal: false, label: app.msgs.menuLabel_stickySidebar, helptip: app.msgs.helptip_stickySidebar }, - anchored: { type: 'toggle', mobile: false, icon: 'anchor', + anchored: { type: 'toggle', mobile: false, icon: 'anchor', defaultVal: false, label: app.msgs.mode_anchor, helptip: app.msgs.helptip_anchorMode }, - bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_background} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_bgAnimations }, - fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_foreground} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_fgAnimations }, replyLang: { type: 'prompt', icon: 'languageChars', @@ -548,7 +554,7 @@ scheme: { type: 'modal', icon: 'scheme', label: app.msgs.menuLabel_colorScheme, helptip: app.msgs.helptip_colorScheme }, - debugMode: { type: 'toggle', icon: 'bug', + debugMode: { type: 'toggle', icon: 'bug', defaultVal: false, label: app.msgs.mode_debug, helptip: app.msgs.helptip_debugMode }, about: { type: 'modal', icon: 'questionMarkCircle', diff --git a/chatgpt-auto-continue/chromium/extension/lib/settings.js b/chatgpt-auto-continue/chromium/extension/lib/settings.js index e185ad93f..9aa378236 100644 --- a/chatgpt-auto-continue/chromium/extension/lib/settings.js +++ b/chatgpt-auto-continue/chromium/extension/lib/settings.js @@ -7,7 +7,7 @@ window.settings = { }, controls: { // displays top-to-bottom in toolbar menu - get notifDisabled() { return { type: 'toggle', + get notifDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_modeNotifs'), helptip: settings.getMsg('helptip_modeNotifs') }} @@ -19,13 +19,17 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get(key, result => { - window.config[key] = result[key] || false ; resolve() + window.config[key] = key in result ? result[key] : + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) }, diff --git a/chatgpt-auto-continue/firefox/extension/lib/settings.js b/chatgpt-auto-continue/firefox/extension/lib/settings.js index e185ad93f..9aa378236 100644 --- a/chatgpt-auto-continue/firefox/extension/lib/settings.js +++ b/chatgpt-auto-continue/firefox/extension/lib/settings.js @@ -7,7 +7,7 @@ window.settings = { }, controls: { // displays top-to-bottom in toolbar menu - get notifDisabled() { return { type: 'toggle', + get notifDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_modeNotifs'), helptip: settings.getMsg('helptip_modeNotifs') }} @@ -19,13 +19,17 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get(key, result => { - window.config[key] = result[key] || false ; resolve() + window.config[key] = key in result ? result[key] : + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) }, diff --git a/chatgpt-auto-refresh/greasemonkey/chatgpt-auto-refresh.user.js b/chatgpt-auto-refresh/greasemonkey/chatgpt-auto-refresh.user.js index 48334e2f9..45fe2778a 100644 --- a/chatgpt-auto-refresh/greasemonkey/chatgpt-auto-refresh.user.js +++ b/chatgpt-auto-refresh/greasemonkey/chatgpt-auto-refresh.user.js @@ -220,7 +220,7 @@ // @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT. // @author Adam Lui // @namespace https://github.com/adamlui -// @version 2025.1.10.1 +// @version 2025.1.11 // @license MIT // @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8 // @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8 @@ -390,17 +390,23 @@ const settings = { controls: { // displays top-to-bottom in toolbar menu - arDisabled: { type: 'toggle', + arDisabled: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_autoRefresh }, - toggleHidden: { type: 'toggle', + toggleHidden: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_toggleVis, helptip: app.msgs.helptip_toggleVis }, - notifDisabled: { type: 'toggle', + notifDisabled: { type: 'toggle', defaultVal: false, label: app.msgs.menuLabel_modeNotifs, helptip: app.msgs.helptip_modeNotifs }, refreshInterval: { type: 'prompt', symbol: '⌚', label: app.msgs.menuLabel_refreshInt, helptip: app.msgs.helptip_refreshInt } }, - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) + }, + save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } } settings.load(Object.keys(settings.controls)) diff --git a/chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js b/chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js index 95f9bd115..aed90093e 100644 --- a/chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js +++ b/chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js @@ -225,7 +225,7 @@ // @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela // @author Adam Lui // @namespace https://github.com/adamlui -// @version 2025.1.10.1 +// @version 2025.1.11 // @license MIT // @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c // @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c @@ -373,11 +373,19 @@ const settings = { controls: { // displays top-to-bottom in toolbar menu - autoTalkDisabled: { type: 'toggle', label: app.msgs.mode_autoTalk }, - toggleHidden: { type: 'toggle', label: app.msgs.menuLabel_toggleVis, helptip: app.msgs.helptip_toggleVis } + autoTalkDisabled: { type: 'toggle', defaultVal: false, + label: app.msgs.mode_autoTalk }, + toggleHidden: { type: 'toggle', defaultVal: false, + label: app.msgs.menuLabel_toggleVis, helptip: app.msgs.helptip_toggleVis } + }, + + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) }, - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } } settings.load(Object.keys(settings.controls)) diff --git a/chatgpt-infinity/chrome/extension/lib/settings.js b/chatgpt-infinity/chrome/extension/lib/settings.js index d358b1bb7..ebb5bc74c 100644 --- a/chatgpt-infinity/chrome/extension/lib/settings.js +++ b/chatgpt-infinity/chrome/extension/lib/settings.js @@ -7,18 +7,18 @@ window.settings = { }, controls: { // displays top-to-bottom in toolbar menu - get infinityMode() { return { type: 'toggle', + get infinityMode() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_infinityMode') }}, - get autoStart() { return { type: 'toggle', + get autoStart() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_autoStart'), helptip: settings.getMsg('helptip_autoStart') }}, - get toggleHidden() { return { type: 'toggle', + get toggleHidden() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_toggleVis'), helptip: settings.getMsg('helptip_toggleVis') }}, - get autoScrollDisabled() { return { type: 'toggle', + get autoScrollDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_autoScroll'), helptip: settings.getMsg('helptip_autoScroll') }}, @@ -45,13 +45,17 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get(key, result => { - window.config[key] = result[key] || false ; resolve() + window.config[key] = key in result ? result[key] : + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) }, diff --git a/chatgpt-infinity/firefox/extension/lib/settings.js b/chatgpt-infinity/firefox/extension/lib/settings.js index d358b1bb7..ebb5bc74c 100644 --- a/chatgpt-infinity/firefox/extension/lib/settings.js +++ b/chatgpt-infinity/firefox/extension/lib/settings.js @@ -7,18 +7,18 @@ window.settings = { }, controls: { // displays top-to-bottom in toolbar menu - get infinityMode() { return { type: 'toggle', + get infinityMode() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_infinityMode') }}, - get autoStart() { return { type: 'toggle', + get autoStart() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_autoStart'), helptip: settings.getMsg('helptip_autoStart') }}, - get toggleHidden() { return { type: 'toggle', + get toggleHidden() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_toggleVis'), helptip: settings.getMsg('helptip_toggleVis') }}, - get autoScrollDisabled() { return { type: 'toggle', + get autoScrollDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_autoScroll'), helptip: settings.getMsg('helptip_autoScroll') }}, @@ -45,13 +45,17 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get(key, result => { - window.config[key] = result[key] || false ; resolve() + window.config[key] = key in result ? result[key] : + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) }, diff --git a/chatgpt-widescreen/chrome/extension/lib/settings.js b/chatgpt-widescreen/chrome/extension/lib/settings.js index f55b15106..7460b1e7f 100644 --- a/chatgpt-widescreen/chrome/extension/lib/settings.js +++ b/chatgpt-widescreen/chrome/extension/lib/settings.js @@ -9,39 +9,39 @@ window.settings = { browserwideKeys: [ 'extensionDisabled', 'fullScreen' ], // to not load/save per-site controls: { // displays top-to-bottom in toolbar menu - get fullerWindows() { return { type: 'toggle', + get fullerWindows() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_fullerWins'), helptip: settings.getMsg('helptip_fullerWins') }}, - get tcbDisabled() { return { type: 'toggle', symbol: '↕️', + get tcbDisabled() { return { type: 'toggle', symbol: '↕️', defaultVal: false, label: settings.getMsg('menuLabel_tallerChatbox'), helptip: settings.getMsg('helptip_tallerChatbox') }}, - get widerChatbox() { return { type: 'toggle', symbol: '↔️', + get widerChatbox() { return { type: 'toggle', symbol: '↔️', defaultVal: false, label: settings.getMsg('menuLabel_widerChatbox'), helptip: settings.getMsg('helptip_widerChatbox') }}, - get ncbDisabled() { return { type: 'toggle', + get ncbDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_newChatBtn'), helptip: settings.getMsg('helptip_newChatBtn') }}, - get hiddenHeader() { return { type: 'toggle', + get hiddenHeader() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_hiddenHeader'), helptip: settings.getMsg('helptip_hiddenHeader') }}, - get hiddenFooter() { return { type: 'toggle', + get hiddenFooter() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_hiddenFooter'), helptip: settings.getMsg('helptip_hiddenFooter') }}, - get btnAnimationsDisabled() { return { type: 'toggle', + get btnAnimationsDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_btnAnimations'), helptip: settings.getMsg('helptip_btnAnimations') }}, - get notifDisabled() { return { type: 'toggle', + get notifDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_modeNotifs'), helptip: settings.getMsg('helptip_modeNotifs') }}, - get blockSpamDisabled() { return { type: 'toggle', + get blockSpamDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_blockSpam'), helptip: settings.getMsg('helptip_blockSpam') }} @@ -53,17 +53,21 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get( - !this.browserwideKeys.includes(key) ? `${this.imports.env.site}_${key}` : key, - result => { window.config[key] = result[`${this.imports.env.site}_${key}`] - || result[key] || false ; resolve() + !this.browserwideKeys.includes(key) ? `${this.imports.env.site}_${key}` : key, result => { + window.config[key] = `${this.imports.env.site}_${key}` in result || key in result ? + result[`${this.imports.env.site}_${key}`] || result[key] + : this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) -}, + }, save(key, val) { if (typeof GM_info != 'undefined') // save to userscript manager storage diff --git a/chatgpt-widescreen/firefox/extension/lib/settings.js b/chatgpt-widescreen/firefox/extension/lib/settings.js index f55b15106..7460b1e7f 100644 --- a/chatgpt-widescreen/firefox/extension/lib/settings.js +++ b/chatgpt-widescreen/firefox/extension/lib/settings.js @@ -9,39 +9,39 @@ window.settings = { browserwideKeys: [ 'extensionDisabled', 'fullScreen' ], // to not load/save per-site controls: { // displays top-to-bottom in toolbar menu - get fullerWindows() { return { type: 'toggle', + get fullerWindows() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_fullerWins'), helptip: settings.getMsg('helptip_fullerWins') }}, - get tcbDisabled() { return { type: 'toggle', symbol: '↕️', + get tcbDisabled() { return { type: 'toggle', symbol: '↕️', defaultVal: false, label: settings.getMsg('menuLabel_tallerChatbox'), helptip: settings.getMsg('helptip_tallerChatbox') }}, - get widerChatbox() { return { type: 'toggle', symbol: '↔️', + get widerChatbox() { return { type: 'toggle', symbol: '↔️', defaultVal: false, label: settings.getMsg('menuLabel_widerChatbox'), helptip: settings.getMsg('helptip_widerChatbox') }}, - get ncbDisabled() { return { type: 'toggle', + get ncbDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_newChatBtn'), helptip: settings.getMsg('helptip_newChatBtn') }}, - get hiddenHeader() { return { type: 'toggle', + get hiddenHeader() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_hiddenHeader'), helptip: settings.getMsg('helptip_hiddenHeader') }}, - get hiddenFooter() { return { type: 'toggle', + get hiddenFooter() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_hiddenFooter'), helptip: settings.getMsg('helptip_hiddenFooter') }}, - get btnAnimationsDisabled() { return { type: 'toggle', + get btnAnimationsDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_btnAnimations'), helptip: settings.getMsg('helptip_btnAnimations') }}, - get notifDisabled() { return { type: 'toggle', + get notifDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_modeNotifs'), helptip: settings.getMsg('helptip_modeNotifs') }}, - get blockSpamDisabled() { return { type: 'toggle', + get blockSpamDisabled() { return { type: 'toggle', defaultVal: false, label: settings.getMsg('menuLabel_blockSpam'), helptip: settings.getMsg('helptip_blockSpam') }} @@ -53,17 +53,21 @@ window.settings = { load(...keys) { keys = keys.flat() // flatten array args nested by spread operator if (typeof GM_info != 'undefined') // synchronously load from userscript manager storage - keys.forEach(key => window.config[key] = GM_getValue( - `${this.imports.app.configKeyPrefix}_${key}`, false)) + keys.forEach(key => { + config[key] = GM_getValue(`${this.imports.app.configKeyPrefix}_${key}`, + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') + }) else // asynchronously load from browser extension storage return Promise.all(keys.map(key => // resolve promise when all keys load new Promise(resolve => // resolve promise when single key value loads chrome.storage.sync.get( - !this.browserwideKeys.includes(key) ? `${this.imports.env.site}_${key}` : key, - result => { window.config[key] = result[`${this.imports.env.site}_${key}`] - || result[key] || false ; resolve() + !this.browserwideKeys.includes(key) ? `${this.imports.env.site}_${key}` : key, result => { + window.config[key] = `${this.imports.env.site}_${key}` in result || key in result ? + result[`${this.imports.env.site}_${key}`] || result[key] + : this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle' + resolve() })))) -}, + }, save(key, val) { if (typeof GM_info != 'undefined') // save to userscript manager storage diff --git a/duckduckgpt/greasemonkey/duckduckgpt.user.js b/duckduckgpt/greasemonkey/duckduckgpt.user.js index dfe7c5a5b..b16c0aa9f 100644 --- a/duckduckgpt/greasemonkey/duckduckgpt.user.js +++ b/duckduckgpt/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 2025.1.10.1 +// @version 2025.1.11 // @license MIT // @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076 // @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076 @@ -385,9 +385,15 @@ // Init DEBUG mode const config = {} const settings = { - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls?.[key]?.defaultVal || this.controls?.[key]?.type == 'toggle') + }) + }, save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } - } ; settings.load('debugMode') + } + settings.load('debugMode') // Define LOG props/functions const log = { @@ -502,44 +508,44 @@ // Init SETTINGS log.debug('Initializing settings...') - Object.assign(settings, { controls: { - proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', + Object.assign(settings, { controls: { // displays top-to-bottom, left-to-right in Settings modal + proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', defaultVal: false, label: app.msgs.menuLabel_proxyAPImode, helptip: app.msgs.helptip_proxyAPImode }, - streamingDisabled: { type: 'toggle', icon: 'signalStream', + streamingDisabled: { type: 'toggle', icon: 'signalStream', defaultVal: false, label: app.msgs.mode_streaming, helptip: app.msgs.helptip_streamingMode }, - autoGet: { type: 'toggle', icon: 'speechBalloonLasso', + autoGet: { type: 'toggle', icon: 'speechBalloonLasso', defaultVal: false, label: app.msgs.menuLabel_autoGetAnswers, helptip: app.msgs.helptip_autoGetAnswers }, - autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', + autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', defaultVal: false, label: app.msgs.menuLabel_autoFocusChatbar, helptip: app.msgs.helptip_autoFocusChatbar }, - autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', + autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', defaultVal: false, label: `${app.msgs.mode_autoScroll} (${app.msgs.menuLabel_whenStreaming})`, helptip: app.msgs.helptip_autoScroll }, - rqDisabled: { type: 'toggle', icon: 'speechBalloons', + rqDisabled: { type: 'toggle', icon: 'speechBalloons', defaultVal: false, label: `${app.msgs.menuLabel_show} ${app.msgs.menuLabel_relatedQueries}`, helptip: app.msgs.helptip_showRelatedQueries }, - prefixEnabled: { type: 'toggle', icon: 'slash', + prefixEnabled: { type: 'toggle', icon: 'slash', defaultVal: false, label: `${app.msgs.menuLabel_require} "/" ${app.msgs.menuLabel_beforeQuery}`, helptip: app.msgs.helptip_prefixMode }, - suffixEnabled: { type: 'toggle', icon: 'questionMark', + suffixEnabled: { type: 'toggle', icon: 'questionMark', defaultVal: false, label: `${app.msgs.menuLabel_require} "?" ${app.msgs.menuLabel_afterQuery}`, helptip: app.msgs.helptip_suffixMode }, - widerSidebar: { type: 'toggle', mobile: false, centered: false, icon: 'widescreen', + widerSidebar: { type: 'toggle', mobile: false, centered: false, icon: 'widescreen', defaultVal: false, label: app.msgs.menuLabel_widerSidebar, helptip: app.msgs.helptip_widerSidebar }, - stickySidebar: { type: 'toggle', mobile: false, centered: false, icon: 'webCorner', + stickySidebar: { type: 'toggle', mobile: false, centered: false, icon: 'webCorner', defaultVal: false, label: app.msgs.menuLabel_stickySidebar, helptip: app.msgs.helptip_stickySidebar }, - anchored: { type: 'toggle', mobile: false, centered: false, icon: 'anchor', + anchored: { type: 'toggle', mobile: false, centered: false, icon: 'anchor', defaultVal: false, label: app.msgs.mode_anchor, helptip: app.msgs.helptip_anchorMode }, - bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_background} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_bgAnimations }, - fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_foreground} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_fgAnimations }, replyLang: { type: 'prompt', icon: 'languageChars', @@ -548,7 +554,7 @@ scheme: { type: 'modal', icon: 'scheme', label: app.msgs.menuLabel_colorScheme, helptip: app.msgs.helptip_colorScheme }, - debugMode: { type: 'toggle', icon: 'bug', + debugMode: { type: 'toggle', icon: 'bug', defaultVal: false, label: app.msgs.mode_debug, helptip: app.msgs.helptip_debugMode }, about: { type: 'modal', icon: 'questionMarkCircle', diff --git a/googlegpt/greasemonkey/googlegpt.user.js b/googlegpt/greasemonkey/googlegpt.user.js index 68d7f8fdd..54277c12e 100644 --- a/googlegpt/greasemonkey/googlegpt.user.js +++ b/googlegpt/greasemonkey/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 2025.1.11 +// @version 2025.1.11.1 // @license MIT // @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2 // @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2 @@ -573,9 +573,15 @@ // Init DEBUG mode const config = {} const settings = { - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, + load(...keys) { + keys.flat().forEach(key => { + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, + this.controls?.[key]?.defaultVal || this.controls?.[key]?.type == 'toggle') + }) + }, save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val } - } ; settings.load('debugMode') + } + settings.load('debugMode') // Define LOG props/functions const log = { @@ -690,44 +696,44 @@ // Init SETTINGS log.debug('Initializing settings...') - Object.assign(settings, { controls: { - proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', + Object.assign(settings, { controls: { // displays top-to-bottom, left-to-right in Settings modal + proxyAPIenabled: { type: 'toggle', icon: 'sunglasses', defaultVal: false, label: app.msgs.menuLabel_proxyAPImode, helptip: app.msgs.helptip_proxyAPImode }, - streamingDisabled: { type: 'toggle', icon: 'signalStream', + streamingDisabled: { type: 'toggle', icon: 'signalStream', defaultVal: false, label: app.msgs.mode_streaming, helptip: app.msgs.helptip_streamingMode }, - autoGet: { type: 'toggle', icon: 'speechBalloonLasso', + autoGet: { type: 'toggle', icon: 'speechBalloonLasso', defaultVal: false, label: app.msgs.menuLabel_autoGetAnswers, helptip: app.msgs.helptip_autoGetAnswers }, - autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', + autoFocusChatbarDisabled: { type: 'toggle', mobile: false, icon: 'caretsInward', defaultVal: false, label: app.msgs.menuLabel_autoFocusChatbar, helptip: app.msgs.helptip_autoFocusChatbar }, - autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', + autoScroll: { type: 'toggle', mobile: false, icon: 'arrowsDown', defaultVal: false, label: `${app.msgs.mode_autoScroll} (${app.msgs.menuLabel_whenStreaming})`, helptip: app.msgs.helptip_autoScroll }, - rqDisabled: { type: 'toggle', icon: 'speechBalloons', + rqDisabled: { type: 'toggle', icon: 'speechBalloons', defaultVal: false, label: `${app.msgs.menuLabel_show} ${app.msgs.menuLabel_relatedQueries}`, helptip: app.msgs.helptip_showRelatedQueries }, - prefixEnabled: { type: 'toggle', icon: 'slash', + prefixEnabled: { type: 'toggle', icon: 'slash', defaultVal: false, label: `${app.msgs.menuLabel_require} "/" ${app.msgs.menuLabel_beforeQuery}`, helptip: app.msgs.helptip_prefixMode }, - suffixEnabled: { type: 'toggle', icon: 'questionMark', + suffixEnabled: { type: 'toggle', icon: 'questionMark', defaultVal: false, label: `${app.msgs.menuLabel_require} "?" ${app.msgs.menuLabel_afterQuery}`, helptip: app.msgs.helptip_suffixMode }, - widerSidebar: { type: 'toggle', mobile: false, icon: 'widescreen', + widerSidebar: { type: 'toggle', mobile: false, icon: 'widescreen', defaultVal: false, label: app.msgs.menuLabel_widerSidebar, helptip: app.msgs.helptip_widerSidebar }, - stickySidebar: { type: 'toggle', mobile: false, icon: 'webCorner', + stickySidebar: { type: 'toggle', mobile: false, icon: 'webCorner', defaultVal: false, label: app.msgs.menuLabel_stickySidebar, helptip: app.msgs.helptip_stickySidebar }, - anchored: { type: 'toggle', mobile: false, icon: 'anchor', + anchored: { type: 'toggle', mobile: false, icon: 'anchor', defaultVal: false, label: app.msgs.mode_anchor, helptip: app.msgs.helptip_anchorMode }, - bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + bgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_background} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_bgAnimations }, - fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', + fgAnimationsDisabled: { type: 'toggle', icon: 'sparkles', defaultVal: false, label: `${app.msgs.menuLabel_foreground} ${app.msgs.menuLabel_animations}`, helptip: app.msgs.helptip_fgAnimations }, replyLang: { type: 'prompt', icon: 'languageChars', @@ -736,7 +742,7 @@ scheme: { type: 'modal', icon: 'scheme', label: app.msgs.menuLabel_colorScheme, helptip: app.msgs.helptip_colorScheme }, - debugMode: { type: 'toggle', icon: 'bug', + debugMode: { type: 'toggle', icon: 'bug', defaultVal: false, label: app.msgs.mode_debug, helptip: app.msgs.helptip_debugMode }, about: { type: 'modal', icon: 'questionMarkCircle',