fix(bidi-dialog): only accept dialogs in active browsing context#14448
fix(bidi-dialog): only accept dialogs in active browsing context#14448christian-bromann merged 2 commits intowebdriverio:mainfrom
Conversation
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/browser-runner
@wdio/browserstack-service
@wdio/appium-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
christian-bromann
left a comment
There was a problem hiding this comment.
Can we add a unit test for this?
|
Quick question, shouldn't we add this check to all public methods, like close() etc as well? |
|
Great change, thanks for picking this up 👍 |
|
Hey Rondleysg 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Yes, sorry, I should have added dismiss() too. |
Proposed changes
This PR adds a context check in the
accept()handler so that we only calldialog.accept()when the dialog actually belongs to the current browsing context. It uses theContextManager.getCurrentContext()helper and bails out early ifthis.#context !== context, preventing “no such frame” errors when multiple contexts fire native‐dialog events.Related issue
Closes #14295
Types of changes
Checklist
Reviewers: @webdriverio/project-committers