Skip to content

🤖 Prevent navigation outside the domain details webview - #19570

Merged
antonis merged 4 commits into
trunkfrom
issue/19501-limit-details-navigation
Nov 9, 2023
Merged

🤖 Prevent navigation outside the domain details webview#19570
antonis merged 4 commits into
trunkfrom
issue/19501-limit-details-navigation

Conversation

@antonis

@antonis antonis commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

Fixes #19501

Description

This PR prevents navigation outside of the domain details context. Any other url is intercepted and opened in the device’s browser instead.
It also extracts the common navigation delegate functionality used in two other places with d52d5b8

To test:

  1. Enable the domain_management feature flag
  2. Open the domain management (Me>Domains or `My Site>More>Domains>ALL)
  3. Tap on a domain
  4. Verify that the details page opens
  5. Try to browse outside the domains scope (e.g. by visiting a support page)
  6. Verify that the link opens in an external browser
Screen_recording_20231108_154509.mp4

Regression Notes

  1. Potential unintended areas of impact
    campaign details webview and domain registration webview

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing and relied on existing DomainRegistrationCheckoutWebViewNavigationDelegateTest and CampaignDetailWebViewNavigationDelegateTest

  3. What automated tests I added (or what prevented me from doing so)
    Added DomainManagementDetailsWebViewNavigationDelegateTest

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes testing checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@antonis antonis added this to the 23.7 milestone Nov 8, 2023
@antonis antonis changed the title import org.wordpress.android.ui.utils.AbstractAllowedUrlsWebViewNavigationDelegate.Url 🤖 Prevent navigation outside the domain details webview Nov 8, 2023
@antonis

antonis commented Nov 8, 2023

Copy link
Copy Markdown
Contributor Author

Please add tests for class DomainManagementDetailsWebViewClient (or add unit-tests-exemption label to ignore this)

Adding the unit-tests-exemption label since the core of the DomainManagementDetailsWebViewClient is tested with DomainManagementDetailsWebViewNavigationDelegateTest

@antonis
antonis marked this pull request as ready for review November 8, 2023 13:55
@wpmobilebot

wpmobilebot commented Nov 8, 2023

Copy link
Copy Markdown
Contributor
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr19570-01aa44d
Commit01aa44d
Direct Downloadwordpress-prototype-build-pr19570-01aa44d.apk
Note: Google Login is not supported on these builds.

@wpmobilebot

wpmobilebot commented Nov 8, 2023

Copy link
Copy Markdown
Contributor
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr19570-01aa44d
Commit01aa44d
Direct Downloadjetpack-prototype-build-pr19570-01aa44d.apk
Note: Google Login is not supported on these builds.

@antonis
antonis requested review from justtwago and mkevins November 8, 2023 14:01
@wpmobilebot

Copy link
Copy Markdown
Contributor
1 Warning
⚠️ Class DomainManagementDetailsWebViewClient is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@justtwago justtwago left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finally "purchased" a test domain to test it and it works nice! All the external links are opened in an external browser. Thanks for adding tests for the delegate! 🎸

@antonis

antonis commented Nov 9, 2023

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing and testing @justtwago 🙇

@antonis
antonis merged commit 1f7a65c into trunk Nov 9, 2023
@antonis
antonis deleted the issue/19501-limit-details-navigation branch November 9, 2023 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🤖 Prevent navigation outside the domain details webview

3 participants