File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { GMdeleteValue , GMgetValue , GMinfo , GMsetValue } from '@lib/compat' ;
22import { difference , groupBy , intersect } from '@lib/util/array' ;
33import { logFailure } from '@lib/util/async' ;
4+ import { onWindowLoaded } from '@lib/util/dom' ;
45
56import { agencyNameToID , validateCode , VERSION as CODES_VERSION } from './identifiers' ;
67import { validateCodes } from './validate' ;
@@ -548,9 +549,13 @@ function handleMB(): void {
548549 // FIXME: We should check the changes in more detail before querying.
549550 const workForms : Array < [ HTMLFormElement , boolean ] > = [ ...document . querySelectorAll < HTMLFormElement > ( editWorkFormQuery ) ] . map ( ( f ) => [ f , false ] ) ;
550551 document . querySelectorAll ( 'iframe' ) . forEach ( ( iframe ) => {
551- iframe . contentWindow ?. document
552- . querySelectorAll < HTMLFormElement > ( 'editWorkFormQuery' )
553- . forEach ( ( form ) => workForms . push ( [ form , true ] ) ) ;
552+ if ( ! iframe . contentWindow ) return ;
553+
554+ onWindowLoaded ( ( ) => {
555+ iframe . contentWindow ! . document
556+ . querySelectorAll < HTMLFormElement > ( editWorkFormQuery )
557+ . forEach ( ( form ) => workForms . push ( [ form , true ] ) ) ;
558+ } , iframe . contentWindow ) ;
554559 } ) ;
555560
556561 workForms
You can’t perform that action at this time.
0 commit comments