Skip to content

Commit a786ea1

Browse files
committed
Made stylesheet append in modals.stylize() conditional since called repeatedly ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-talk]
1 parent 49034f2 commit a786ea1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chatgpt/chatgpt-auto-talk/chatgpt-auto-talk.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.4.27
228+
// @version 2025.4.27.1
229229
// @license MIT
230230
// @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
231231
// @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
@@ -651,7 +651,8 @@
651651
safeWinOpen(url) { open(url, '_blank', 'noopener') }, // to prevent backdoor vulnerabilities
652652

653653
stylize() {
654-
document.head.append(this.styles = dom.create.style(
654+
if (!this.styles) document.head.append(this.styles = dom.create.elem('style'))
655+
this.styles.innerText = (
655656
`.${this.class} {` // modals
656657
+ 'user-select: none ; -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ;'
657658
+ 'font-family: -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto,'
@@ -687,7 +688,7 @@
687688
+ `background-color: #${ env.ui.scheme == 'dark' ? '00cfff' : '9cdaff' } !important }`
688689
+ ( !env.browser.isMobile ? `.${this.class} .modal-buttons { margin-left: -13px !important }` : '' )
689690
+ `.about-em { color: ${ env.ui.scheme == 'dark' ? 'white' : 'green' } !important }`
690-
))
691+
)
691692
},
692693

693694
update: {

0 commit comments

Comments
 (0)