Skip to content

Commit 0fcea60

Browse files
committed
Condensed createMenuEntry(), added comments ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 48d78bd commit 0fcea60

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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.9.2.3",
6+
"version": "2025.9.2.4",
77
"author": "KudoAI",
88
"homepage_url": "https://github.com/KudoAI/chatgpt.js-chrome-starter",
99
"icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", "64": "icons/icon64.png", "128": "icons/icon128.png" },

starters/chrome/extension/popup/controller.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@
3939
if (entryData.status) entry.label.textContent += ` — ${entryData.status}`
4040
if (entryData.type == 'link') {
4141
entry.label.after(entry.rightElem = dom.create.elem('div', { class: 'menu-right-elem' }))
42-
entry.favicon = !entryData.favicon ? null
43-
: dom.create.elem('img', { width: 15,
44-
src: typeof entryData.favicon == 'string' ? entryData.favicon
42+
if (entryData.favicon) entry.favicon = dom.create.elem('img', { width: 15,
43+
src: typeof entryData.favicon == 'string' ? entryData.favicon
4544
: `https://www.google.com/s2/favicons?domain=${new URL(entryData.url).hostname}` })
4645
entry.openIcon = icons.create({ key: 'open', size: 17, fill: 'black' })
4746
entry.rightElem.append(entry.favicon || entry.openIcon)
4847
if (entry.favicon) entry.rightElem.onmouseenter = entry.rightElem.onmouseleave = event =>
4948
entry.rightElem.firstChild.replaceWith(entry[event.type == 'mouseenter' ? 'openIcon' : 'favicon'])
5049
}
5150
}
52-
if (entryData.type == 'category')
51+
if (entryData.type == 'category') // add caret
5352
entry.div.append(icons.create({ key: 'caretDown', size: 11, class: 'menu-caret menu-right-elem' }))
5453
else if (entryData.type == 'slider') { // append slider, add listeners, remove .highlight-on-hover
5554
entry.slider = dom.create.elem('input', { class: 'slider', type: 'range',
@@ -69,7 +68,7 @@
6968
}
7069
entry.div.append(entry.slider) ; entry.div.classList.remove('highlight-on-hover')
7170
}
72-
if (entryData.dependencies) {
71+
if (entryData.dependencies) { // hide/show accordingly
7372
const toDisable = Object.values(entryData.dependencies).flat().some(dep => !settings.typeIsEnabled(dep))
7473
Object.assign(entry.div.style, {
7574
transition: '', minHeight: 'auto', opacity: +!toDisable,

0 commit comments

Comments
 (0)