chore: add bringToFront for BiDi (#10685)

This commit is contained in:
Nikolay Vitkov 2023-08-03 19:58:28 +02:00 committed by GitHub
parent 7ecfe150a1
commit d9a596511e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,10 @@ interface Commands {
returnType: Bidi.Script.AddPreloadScriptResult; returnType: Bidi.Script.AddPreloadScriptResult;
}; };
'browsingContext.activate': {
params: Bidi.BrowsingContext.ActivateParameters;
returnType: Bidi.EmptyResult;
};
'browsingContext.create': { 'browsingContext.create': {
params: Bidi.BrowsingContext.CreateParameters; params: Bidi.BrowsingContext.CreateParameters;
returnType: Bidi.BrowsingContext.CreateResult; returnType: Bidi.BrowsingContext.CreateResult;

View File

@ -712,6 +712,12 @@ export class Page extends PageBase {
}); });
return new CDPSessionWrapper(this.mainFrame().context(), sessionId); return new CDPSessionWrapper(this.mainFrame().context(), sessionId);
} }
override async bringToFront(): Promise<void> {
await this.#connection.send('browsingContext.activate', {
context: this.mainFrame()._id,
});
}
} }
function isConsoleLogEntry( function isConsoleLogEntry(