@@ -100,6 +100,16 @@ document.addEventListener("DOMContentLoaded", async () => {
100100 item . className = "script-item" ;
101101 item . dataset . id = index ;
102102
103+ // Icon
104+ if ( script . icon ) {
105+ const iconImg = document . createElement ( "img" ) ;
106+ iconImg . src = script . icon ;
107+ iconImg . alt = "" ;
108+ iconImg . className = "script-icon" ;
109+ iconImg . onerror = ( ) => iconImg . remove ( ) ;
110+ item . appendChild ( iconImg ) ;
111+ }
112+
103113 const toggleContainer = document . createElement ( "div" ) ;
104114 toggleContainer . className = "script-toggle" ;
105115
@@ -122,19 +132,11 @@ document.addEventListener("DOMContentLoaded", async () => {
122132 label . appendChild ( slider ) ;
123133 toggleContainer . appendChild ( label ) ;
124134
135+ item . appendChild ( toggleContainer ) ;
136+
125137 const info = document . createElement ( "div" ) ;
126138 info . className = "script-info" ;
127139
128- // Icon
129- if ( script . icon ) {
130- const iconImg = document . createElement ( "img" ) ;
131- iconImg . src = script . icon ;
132- iconImg . alt = "" ;
133- iconImg . className = "script-icon" ;
134- iconImg . onerror = ( ) => iconImg . remove ( ) ;
135- item . appendChild ( iconImg ) ;
136- }
137-
138140 const name = document . createElement ( "div" ) ;
139141 name . className = "script-name" ;
140142 name . textContent = script . name ;
@@ -160,7 +162,6 @@ document.addEventListener("DOMContentLoaded", async () => {
160162 chrome . tabs . create ( { url : `editor.html?id=${ script . id } ` } ) ;
161163 } ) ;
162164
163- item . appendChild ( toggleContainer ) ;
164165 item . appendChild ( info ) ;
165166
166167 if ( script . enabled === false ) {
0 commit comments