Bug 1853302 - [bidi] Do not send browsingContext.userPromptOpened event for unsupported prompt types. r=webdriver-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D188711
This commit is contained in:
Alexandra Borovova 2023-09-20 12:26:17 +00:00
parent 8cd256b8d7
commit cde1bb94e8

View File

@ -1285,6 +1285,12 @@ class BrowsingContextModule extends Module {
#onPromptOpened = async (eventName, data) => {
if (this.#subscribedEvents.has("browsingContext.userPromptOpened")) {
const { contentBrowser, prompt } = data;
// Do not send opened event for unsupported prompt types.
if (!(prompt.promptType in UserPromptType)) {
return;
}
const contextId = lazy.TabManager.getIdForBrowser(contentBrowser);
// This event is emitted from the parent process but for a given browsing
// context. Set the event's contextInfo to the message handler corresponding