Skip to content

Commit 7d0c829

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

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.10.11.4
6+
// @version 2025.10.11.5
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -1406,9 +1406,7 @@
14061406
},
14071407

14081408
init(modal) { // requires lib/dom.js
1409-
if (!this.styles) this.stylize() // to init/append stylesheet
1410-
1411-
// Add classes
1409+
this.stylize()
14121410
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
14131411

14141412
// Add listeners
@@ -1813,7 +1811,7 @@
18131811
},
18141812

18151813
stylize() {
1816-
if (!this.styles) document.head.append(this.styles = dom.create.elem('style'))
1814+
if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style())
18171815
this.styles.textContent = (
18181816

18191817
// Vars

0 commit comments

Comments
 (0)