mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: waitForNavigation
should fail if navigation aborts or fails (#11914)
This commit is contained in:
parent
634d5b805d
commit
bd4d0febf0
@ -309,7 +309,19 @@ export class BidiFrame extends Frame {
|
||||
fromEmitterEvent(this.browsingContext, 'navigation').pipe(
|
||||
switchMap(({navigation}) => {
|
||||
return this.#waitForLoad$(options).pipe(
|
||||
raceWith(fromEmitterEvent(navigation, 'fragment')),
|
||||
raceWith(
|
||||
fromEmitterEvent(navigation, 'fragment'),
|
||||
fromEmitterEvent(navigation, 'failed').pipe(
|
||||
map(({url}) => {
|
||||
throw new Error(`Navigation failed: ${url}`);
|
||||
})
|
||||
),
|
||||
fromEmitterEvent(navigation, 'aborted').pipe(
|
||||
map(({url}) => {
|
||||
throw new Error(`Navigation aborted: ${url}`);
|
||||
})
|
||||
)
|
||||
),
|
||||
map(() => {
|
||||
return navigation;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user