Skip to content

Commit 2e2dbf2

Browse files
committed
Made style handling more robust ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
1 parent b2431e6 commit 2e2dbf2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.10.11.6
151+
// @version 2025.10.11.7
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f
154154
// @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f
@@ -1743,7 +1743,7 @@
17431743
// Assemble/insert elems
17441744
slider.append(sliderThumb, sliderTip)
17451745
app.div.insertBefore(slider, app.div.querySelector(`.${app.slug}-tooltip,` // desktop
1746-
+ '.reply-bubble')) // mobile
1746+
+ '.reply-bubble')) // mobile
17471747
// Init thumb pos
17481748
setTimeout(() => {
17491749
const iniLeft = (config.fontSize - config.minFontSize) / (config.maxFontSize - config.minFontSize)
@@ -2079,9 +2079,7 @@
20792079
},
20802080

20812081
init(modal) { // requires lib/dom.js
2082-
if (!this.styles) this.stylize() // to init/append stylesheet
2083-
2084-
// Add classes
2082+
this.stylize()
20852083
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
20862084

20872085
// Add listeners
@@ -2501,7 +2499,7 @@
25012499
},
25022500

25032501
stylize() {
2504-
if (!this.styles) document.head.append(this.styles = dom.create.elem('style'))
2502+
if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style())
25052503
this.styles.textContent = (
25062504

25072505
// Vars

0 commit comments

Comments
 (0)