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 1
1
function init ( ) {
2
-
3
2
function getAllEventsNames ( ) {
4
3
const events = Array . from ( Object . keys ( window ) . filter ( key => / ^ o n / . test ( key ) ) . map ( e => e . slice ( 2 ) ) ) ;
5
4
events . push ( 'hover' ) ;
@@ -32,11 +31,6 @@ function init() {
32
31
return path . join ( '>' ) ;
33
32
}
34
33
35
- const EVENTS = getAllEventsNames ( ) ;
36
- const ELEMENTS_TAGS = getAllElementsTagsNames ( ) ;
37
-
38
- document . addEventListener ( 'DOMContentLoaded' , main ) ;
39
-
40
34
function main ( ) {
41
35
const elements = document . querySelectorAll ( '[class*="["]' ) ;
42
36
const regularExpressionsComments = [
@@ -162,5 +156,11 @@ function init() {
162
156
document . dispatchEvent ( event ) ;
163
157
}
164
158
159
+ const EVENTS = getAllEventsNames ( ) ;
160
+ const ELEMENTS_TAGS = getAllElementsTagsNames ( ) ;
161
+
162
+ main ( ) ;
165
163
}
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