From e4dfaaddaacd712f4c9bf41dc6c041054d5120d9 Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Sat, 24 Aug 2024 09:16:14 -0700 Subject: [PATCH] Added type conversion to `log.info()` to prevent uncaught exceptions in TM (Tampermonkey/tampermonkey#2158) --- amazongpt/greasemonkey/amazongpt.user.js | 5 +++-- bravegpt/greasemonkey/bravegpt.user.js | 5 +++-- duckduckgpt/greasemonkey/duckduckgpt.user.js | 5 +++-- googlegpt/greasemonkey/googlegpt.user.js | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/amazongpt/greasemonkey/amazongpt.user.js b/amazongpt/greasemonkey/amazongpt.user.js index a7e83f8777..d47fe7c27f 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 2024.8.22.3 +// @version 2024.8.22.4 // @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 @@ -432,7 +432,8 @@ } const log = { - info(msg) { console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ msg }`) }, + info(msg) {console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ + typeof label == 'msg' ? JSON.stringify(msg) : msg }`) }, err(label, msg) { console.error( `${config.appSymbol} ${config.appName} » ${ log.prefix || '' }${ typeof label == 'object' ? JSON.stringify(label) : label }${ msg ? `: ${msg}` : ''}`)} } diff --git a/bravegpt/greasemonkey/bravegpt.user.js b/bravegpt/greasemonkey/bravegpt.user.js index d8cf87af8b..5a9c3ad9c0 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 2024.8.24.3 +// @version 2024.8.24.4 // @license MIT // @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287 // @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287 @@ -576,7 +576,8 @@ setTimeout(async () => { } const log = { - info(msg) { console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ msg }`) }, + info(msg) {console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ + typeof label == 'msg' ? JSON.stringify(msg) : msg }`) }, err(label, msg) { console.error( `${config.appSymbol} ${config.appName} » ${ log.prefix || '' }${ typeof label == 'object' ? JSON.stringify(label) : label }${ msg ? `: ${msg}` : ''}`)} } diff --git a/duckduckgpt/greasemonkey/duckduckgpt.user.js b/duckduckgpt/greasemonkey/duckduckgpt.user.js index 89022aa442..6a6812f3cf 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 2024.8.24.2 +// @version 2024.8.24.3 // @license MIT // @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302 // @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302 @@ -582,7 +582,8 @@ } const log = { - info(msg) { console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ msg }`) }, + info(msg) {console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ + typeof label == 'msg' ? JSON.stringify(msg) : msg }`) }, err(label, msg) { console.error( `${config.appSymbol} ${config.appName} » ${ log.prefix || '' }${ typeof label == 'object' ? JSON.stringify(label) : label }${ msg ? `: ${msg}` : ''}`)} } diff --git a/googlegpt/greasemonkey/googlegpt.user.js b/googlegpt/greasemonkey/googlegpt.user.js index b553800fb7..d99690cfac 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 2024.8.24.4 +// @version 2024.8.24.5 // @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 @@ -771,7 +771,8 @@ } const log = { - info(msg) { console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ msg }`) }, + info(msg) {console.info(`${ config.appSymbol } ${ config.appName } » ${ log.prefix || '' }${ + typeof label == 'msg' ? JSON.stringify(msg) : msg }`) }, err(label, msg) { console.error( `${config.appSymbol} ${config.appName} » ${ log.prefix || '' }${ typeof label == 'object' ? JSON.stringify(label) : label }${ msg ? `: ${msg}` : ''}`)} }