File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,10 +68,6 @@ const observer = new MutationObserver((mutations) => {
6868 }
6969 } ) ;
7070} ) ;
71- observer . observe ( document . body , {
72- childList : true ,
73- subtree : true ,
74- } ) ;
7571
7672const darkModeMappingBackground = {
7773 'white' : 'rgb(31,32,35)' ,
@@ -151,9 +147,9 @@ async function applyDarkMode() {
151147 } else if ( typeof chrome !== 'undefined' ) {
152148 result = await new Promise ( resolve => chrome . storage . local . get ( 'darkMode' , resolve ) ) ;
153149 }
154-
150+
155151 const darkMode = result . darkMode || false ;
156-
152+
157153 if ( document . title !== 'RabbitMQ Management' ) {
158154 console . log ( 'Not on RabbitMQ Management page, skipping dark mode' ) ;
159155 return ;
@@ -215,4 +211,18 @@ async function applyDarkMode() {
215211 } ) ;
216212}
217213
218- applyDarkMode ( ) ;
214+ function bunnyPackSetup ( ) {
215+ if ( document . title !== 'RabbitMQ Management' ) {
216+ console . log ( 'Not on RabbitMQ Management page, skipping dark mode' ) ;
217+ return ;
218+ }
219+
220+ observer . observe ( document . body , {
221+ childList : true ,
222+ subtree : true ,
223+ } ) ;
224+
225+ applyDarkMode ( ) ;
226+ }
227+
228+ bunnyPackSetup ( ) ;
You can’t perform that action at this time.
0 commit comments