Skip to content

Commit 49034f2

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/autoclear-chatgpt-history]
1 parent b980c73 commit 49034f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
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.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -675,7 +675,8 @@
675675
safeWinOpen(url) { open(url, '_blank', 'noopener') }, // to prevent backdoor vulnerabilities
676676

677677
stylize() {
678-
document.head.append(this.styles = dom.create.style(
678+
if (!this.styles) document.head.append(this.styles = dom.create.elem('style'))
679+
this.styles.innerText = (
679680
`.${this.class} {` // modals
680681
+ 'user-select: none ; -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ;'
681682
+ 'font-family: -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto,'
@@ -711,7 +712,7 @@
711712
+ `background-color: #${ env.ui.scheme == 'dark' ? '00cfff' : '9cdaff' } !important }`
712713
+ ( !env.browser.isMobile ? `.${this.class} .modal-buttons { margin-left: -13px !important }` : '' )
713714
+ `.about-em { color: ${ env.ui.scheme == 'dark' ? 'white' : 'green' } !important }`
714-
))
715+
)
715716
},
716717

717718
update: {

0 commit comments

Comments
 (0)