@@ -1028,7 +1028,9 @@ const create = function (specWindow, Cypress, Cookies, state, config, log) {
10281028 let onpl ; let r
10291029
10301030 try {
1031- setWindowDocumentProps ( getContentWindow ( $autIframe ) , state )
1031+ const autWindow = getContentWindow ( $autIframe )
1032+
1033+ setWindowDocumentProps ( autWindow , state )
10321034
10331035 // we may need to update the url now
10341036 urlNavigationEvent ( 'load' )
@@ -1037,14 +1039,25 @@ const create = function (specWindow, Cypress, Cookies, state, config, log) {
10371039 // because they would have been automatically applied during
10381040 // onBeforeAppWindowLoad, but in the case where we visited
10391041 // about:blank in a visit, we do need these
1040- contentWindowListeners ( getContentWindow ( $autIframe ) )
1042+ contentWindowListeners ( autWindow )
10411043
10421044 Cypress . action ( 'app:window:load' , state ( 'window' ) )
10431045
1044- // we are now stable again which is purposefully
1045- // the last event we call here, to give our event
1046- // listeners time to be invoked prior to moving on
1047- return stability . isStable ( true , 'load' )
1046+ // FIXME: temporary hard-coded hack to get multidomain working
1047+ if ( ! autWindow ?. location ?. pathname ?. includes ( 'multidomain-aut' ) ) {
1048+ // we are now stable again which is purposefully
1049+ // the last event we call here, to give our event
1050+ // listeners time to be invoked prior to moving on
1051+ return stability . isStable ( true , 'load' )
1052+ }
1053+
1054+ Cypress . once ( 'cross:domain:window:load' , ( ) => {
1055+ Cypress . once ( 'cross:domain:driver:ready' , ( ) => {
1056+ stability . isStable ( true , 'load' )
1057+ } )
1058+
1059+ Cypress . action ( 'cy:switch:domain' , 'localhost:3501' )
1060+ } )
10481061 } catch ( err ) {
10491062 let e = err
10501063
0 commit comments