File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11function init ( ) {
2-
32 function getAllEventsNames ( ) {
43 const events = Array . from ( Object . keys ( window ) . filter ( key => / ^ o n / . test ( key ) ) . map ( e => e . slice ( 2 ) ) ) ;
54 events . push ( 'hover' ) ;
@@ -32,11 +31,6 @@ function init() {
3231 return path . join ( '>' ) ;
3332 }
3433
35- const EVENTS = getAllEventsNames ( ) ;
36- const ELEMENTS_TAGS = getAllElementsTagsNames ( ) ;
37-
38- document . addEventListener ( 'DOMContentLoaded' , main ) ;
39-
4034 function main ( ) {
4135 const elements = document . querySelectorAll ( '[class*="["]' ) ;
4236 const regularExpressionsComments = [
@@ -162,5 +156,11 @@ function init() {
162156 document . dispatchEvent ( event ) ;
163157 }
164158
159+ const EVENTS = getAllEventsNames ( ) ;
160+ const ELEMENTS_TAGS = getAllElementsTagsNames ( ) ;
161+
162+ main ( ) ;
165163}
166- window . CSSinJSinHTML = { init } ;
164+ document . addEventListener ( 'DOMContentLoaded' , init ) ;
165+ const observer = new MutationObserver ( init ) ;
166+ observer . observe ( document , { attributes : true , childList : true , subtree : true } ) ;
You can’t perform that action at this time.
0 commit comments