@@ -429,7 +429,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
429
429
this . ignoreSynchronization = false ;
430
430
this . getPageTimeout = DEFAULT_GET_PAGE_TIMEOUT ;
431
431
this . params = { } ;
432
- this . ready = null ;
433
432
this . plugins_ = new Plugins ( { } ) ;
434
433
this . resetUrl = DEFAULT_RESET_URL ;
435
434
this . debugHelper = new DebugHelper ( this ) ;
@@ -451,17 +450,22 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
451
450
ng12Hybrid_ = ng12Hybrid ;
452
451
}
453
452
} ) ;
454
- this . driver . getCapabilities ( ) . then ( ( caps : Capabilities ) => {
455
- // Internet Explorer does not accept data URLs, which are the default
456
- // reset URL for Protractor.
457
- // Safari accepts data urls, but SafariDriver fails after one is used.
458
- // PhantomJS produces a "Detected a page unload event" if we use data urls
459
- let browserName = caps . get ( 'browserName' ) ;
460
- if ( browserName === 'internet explorer' || browserName === 'safari' ||
461
- browserName === 'phantomjs' || browserName === 'MicrosoftEdge' ) {
462
- this . resetUrl = 'about:blank' ;
463
- }
464
- } ) ;
453
+ this . ready = this . driver . controlFlow ( )
454
+ . execute ( ( ) => {
455
+ return this . driver . getSession ( ) ;
456
+ } )
457
+ . then ( ( session : Session ) => {
458
+ // Internet Explorer does not accept data URLs, which are the default
459
+ // reset URL for Protractor.
460
+ // Safari accepts data urls, but SafariDriver fails after one is used.
461
+ // PhantomJS produces a "Detected a page unload event" if we use data urls
462
+ let browserName = session . getCapabilities ( ) . get ( 'browserName' ) ;
463
+ if ( browserName === 'internet explorer' || browserName === 'safari' ||
464
+ browserName === 'phantomjs' || browserName === 'MicrosoftEdge' ) {
465
+ this . resetUrl = 'about:blank' ;
466
+ }
467
+ return this ;
468
+ } ) ;
465
469
466
470
this . trackOutstandingTimeouts_ = ! opt_untrackOutstandingTimeouts ;
467
471
this . mockModules_ = [ ] ;
0 commit comments