Skip to content

Commit 92758e7

Browse files
committed
Made style handling more robust ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/bravegpt]
1 parent 7f5c951 commit 92758e7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

chatgpt/bravegpt/bravegpt.user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.10.11.8
151+
// @version 2025.10.11.9
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2
154154
// @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2
@@ -2074,9 +2074,7 @@
20742074
},
20752075

20762076
init(modal) { // requires lib/dom.js
2077-
if (!this.styles) this.stylize() // to init/append stylesheet
2078-
2079-
// Add classes
2077+
this.stylize()
20802078
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
20812079

20822080
// Add listeners
@@ -2498,7 +2496,7 @@
24982496
},
24992497

25002498
stylize() {
2501-
if (!this.styles) document.head.append(this.styles = dom.create.elem('style'))
2499+
if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style())
25022500
this.styles.textContent = (
25032501

25042502
// Vars

0 commit comments

Comments
 (0)