File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,18 @@ if (location.protocol == "file:") {
170170 } ;
171171
172172 const watch = watching => {
173+ if ( ! ( watching instanceof Element ) ) {
174+ return false ;
175+ }
173176 checkSrc ( watching ) ;
174177 if ( watchList . has ( watching ) ) {
175178 return ;
176179 }
177- observer . observe ( watching , mutOpts ) ;
178180 watchList . add ( watching ) ;
179181 for ( const eventType of EVENTS ) {
180182 watching . addEventListener ( eventType , suppress , true ) ;
181183 }
184+ return true ;
182185 } ;
183186
184187 const mutOpts = {
@@ -193,8 +196,9 @@ if (location.protocol == "file:") {
193196 case "childList" :
194197 [ ...r . addedNodes ] . forEach ( watch ) ;
195198 [ ...r . removedNodes ] . forEach ( removed => {
196- watch ( removed ) ;
197- observer . observe ( removed , mutOpts ) ;
199+ if ( watch ( removed ) ) {
200+ observer . observe ( removed , mutOpts ) ;
201+ }
198202 } ) ;
199203 break ;
200204 case "attributes" :
You can’t perform that action at this time.
0 commit comments