File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed
Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change 55 s = d . createElement ( 'script' ) ;
66 s . src = 'https://chat-assets.frontapp.com/v1/chat.bundle.js' ;
77 s . async = 1 ;
8+ d . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( s ) ;
89
910 s . onload = function ( ) {
1011 if ( window . FrontChat ) {
11- window . FrontChat ( 'init' , { chatId : chatId , useDefaultLauncher : true } ) ;
12+ window . FrontChat ( 'init' , {
13+ chatId : chatId ,
14+ useDefaultLauncher : true ,
15+ colorScheme : 'light dark' ,
16+ } ) ;
1217 }
13-
14- // Workaround for Front's color-scheme bug
15- // Front's widget uses color-scheme: normal which doesn't respect page color schemes
16- // This override allows proper light/dark mode support
17- const styleOverride = d . createElement ( 'style' ) ;
18- styleOverride . textContent = `
19- [data-front-chat-container],
20- [data-front-chat-container] iframe,
21- #front-chat-container,
22- #front-chat-container iframe {
23- color-scheme: light dark !important;
24- }
25- ` ;
26- d . head . appendChild ( styleOverride ) ;
2718 } ;
2819
29- // Append to body (just before closing </body> tag) as per Front's documentation
30- d . getElementsByTagName ( 'body' ) [ 0 ] . appendChild ( s ) ;
20+ d . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( s ) ;
3121} ) ( window , document ) ;
You can’t perform that action at this time.
0 commit comments