Skip to content

Commit b5cd51f

Browse files
committed
Merge pull request #463 from geghamyan/improve-error-logging
Added type check for console.error args to prevent startsWith() error… ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js]
1 parent bd0643e commit b5cd51f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

starters/chrome/extension/lib/chatgpt.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,8 +2132,11 @@ function toCamelCase(words) {
21322132
// Prefix console logs w/ '🤖 chatgpt.js >> '
21332133
const consolePrefix = '🤖 chatgpt.js >> ', ogError = console.error, ogInfo = console.info
21342134
console.error = (...args) => {
2135-
if (!args[0].startsWith(consolePrefix)) ogError(consolePrefix + args[0], ...args.slice(1))
2136-
else ogError(...args)
2135+
if (typeof args[0] === 'string') {
2136+
if (!args[0].startsWith(consolePrefix)) ogError(consolePrefix + args[0], ...args.slice(1))
2137+
else ogError(...args)
2138+
}
2139+
else ogError(consolePrefix, ...args)
21372140
}
21382141
console.info = (msg) => {
21392142
if (!msg.startsWith(consolePrefix)) ogInfo(consolePrefix + msg);

starters/chrome/extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "ChatGPT Extension",
44
"short_name": "ChatGPT 🧩",
55
"description": "A Chromium extension template to start using chatgpt.js like a boss!",
6-
"version": "2025.12.16",
6+
"version": "2026.1.4",
77
"homepage_url": "https://github.com/KudoAI/chatgpt.js-chrome-starter",
88
"icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", "64": "icons/icon64.png", "128": "icons/icon128.png" },
99
"permissions": ["activeTab", "storage"],

0 commit comments

Comments
 (0)