@@ -348,7 +348,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
348
348
this . ignoreSynchronization = false ;
349
349
this . getPageTimeout = DEFAULT_GET_PAGE_TIMEOUT ;
350
350
this . params = { } ;
351
- this . ready = null ;
352
351
this . plugins_ = new Plugins ( { } ) ;
353
352
this . resetUrl = DEFAULT_RESET_URL ;
354
353
this . debugHelper = new DebugHelper ( this ) ;
@@ -370,17 +369,22 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
370
369
ng12Hybrid_ = ng12Hybrid ;
371
370
}
372
371
} ) ;
373
- this . driver . getCapabilities ( ) . then ( ( caps : Capabilities ) => {
374
- // Internet Explorer does not accept data URLs, which are the default
375
- // reset URL for Protractor.
376
- // Safari accepts data urls, but SafariDriver fails after one is used.
377
- // PhantomJS produces a "Detected a page unload event" if we use data urls
378
- let browserName = caps . get ( 'browserName' ) ;
379
- if ( browserName === 'internet explorer' || browserName === 'safari' ||
380
- browserName === 'phantomjs' || browserName === 'MicrosoftEdge' ) {
381
- this . resetUrl = 'about:blank' ;
382
- }
383
- } ) ;
372
+ this . ready = this . driver . controlFlow ( )
373
+ . execute ( ( ) => {
374
+ return this . driver . getSession ( ) ;
375
+ } )
376
+ . then ( ( session : Session ) => {
377
+ // Internet Explorer does not accept data URLs, which are the default
378
+ // reset URL for Protractor.
379
+ // Safari accepts data urls, but SafariDriver fails after one is used.
380
+ // PhantomJS produces a "Detected a page unload event" if we use data urls
381
+ let browserName = session . getCapabilities ( ) . get ( 'browserName' ) ;
382
+ if ( browserName === 'internet explorer' || browserName === 'safari' ||
383
+ browserName === 'phantomjs' || browserName === 'MicrosoftEdge' ) {
384
+ this . resetUrl = 'about:blank' ;
385
+ }
386
+ return this ;
387
+ } ) ;
384
388
385
389
this . trackOutstandingTimeouts_ = ! opt_untrackOutstandingTimeouts ;
386
390
this . mockModules_ = [ ] ;
0 commit comments