Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent inactive tabs from presenting alerts #637

Merged

Conversation

samsymons
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1177771139624306/1202569779116574/f
Tech Design URL:
CC:

Description:

This PR adds checks to the JavaScript alert presentation callbacks to verify that the webview requesting it is the same one that is visible on the BrowserTabViewController.

Steps to test this PR:

  1. Open this JSFiddle in a tab, running on this branch
  2. Click the alert button, and wait 2 seconds to check that the alert appears
  3. Click the alert button again and then immediately select another tab, verify that no alert appears
  4. Perform the same test on other tab types, such as the new tab page

Testing checklist:

  • Test with Release configuration
  • Test proper deallocation of tabs
  • Make sure committed submodule changes are desired

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@Bunn Bunn self-assigned this Jul 7, 2022
Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on both JSFiddle and privacy test page
working as expected.

LGTM ✅

@samsymons samsymons merged commit 7bcef0c into develop Jul 7, 2022
@samsymons samsymons deleted the sam/prevent-alerts-from-inactive-tabs-from-appearing branch July 7, 2022 21:29
samsymons added a commit that referenced this pull request Jul 8, 2022
# By Fernando Bunn (6) and others
# Via Chris Brind (3) and others
* develop:
  update files and bump release verison
  Check the image rule compilation error correctly (#635)
  Check that the alerting WKWebView is currently selected. (#637)
  Fix issue when unplugging external monitor (#629)
  Select tabs when browser is not focused (#632)
  Revert "Update BSK for iOS app group (#630)" (#634)
  Use updated BSK branch (#627)
  Version 0.26.5
  Embedded files updated
  Update BSK for iOS app group (#630)
  Recently Closed Menu Item (#617)
  Close dashboard when closing tab with cmd + w (#628)
  chore(deps): bump Autofill to 4.7.0 (#631)
  Handle legacy crash logs and use proper architecture in symbolicate.js (#621)
  Detect when Chrome login fails due to keychain prompt denial (#633)
  Correctly display unprotected sites on dashboard (#624)
  Update homefavicon (#625)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
samsymons added a commit that referenced this pull request Jul 10, 2022
* develop:
  update files and bump release verison
  Check the image rule compilation error correctly (#635)
  Check that the alerting WKWebView is currently selected. (#637)
@ayoy ayoy unassigned Bunn Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants