| 455 | * signaling we need to try again. |
| 456 | */ |
| 457 | const openThenWaitClose = async (ctx: Context) => { |
| 458 | if (open) { |
| 459 | await open(selector) |
| 460 | } |
| 461 | this.codeServer.logger.debug(`watching ${selector}`) |
| 462 | try { |
| 463 | await this.page.waitForSelector(`${selector}:not(:focus-within)`) |
| 464 | } catch (error) { |
| 465 | if (!ctx.finished()) { |
| 466 | this.codeServer.logger.debug(`${selector} navigation: ${(error as any).message || error}`) |
| 467 | } |
| 468 | } |
| 469 | return false |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * This will step through each item, aborting and returning false if |