Skip to content

Commit cc6a017

Browse files
committed
Added scheme observer to update modal colors + env.scheme ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 4ce1553 commit cc6a017

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

starters/chrome/extension/content.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
settings.save('skipAlert', !config.skipAlert) }
9999
)
100100

101+
// Monitor SCHEME CHANGES to update modal colors + env.scheme for your use
102+
new MutationObserver(() => { env.scheme = getScheme() ; modals.stylize() })
103+
.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] })
104+
101105
// Your code here...
102106
// Your code here...
103107
// Your code here...

0 commit comments

Comments
 (0)