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

fix: Browser dialog prompts in app #10540

Merged

Conversation

Daniel-Cross
Copy link
Contributor

@Daniel-Cross Daniel-Cross commented Aug 2, 2024

Description

Added a function that checks to see if the Webview Tab is currently in focus. If the user navigates away from the webview at any point, the app will stop any JS execution in the webview. If the user remains in the webview tab, JS execution will continue as expected.

Related issues

Fixes: Browser Dialog prompts can overlay outside of tab

Manual testing steps

  1. Download the following file and visit it in the MM Mobile browser: https://github.com/MetaMask/temp-poc-templates-repo/blob/obs3rv3r-pocs/metamask-poc.html
  2. Upon loading the page, switch to another part of the app, such as the settings page or the home page.
  3. See that the browser UI prompts still show up over the application
  4. Do steps 1-2 again but this time visit another tab in the browser.
  5. See that the prompts show up over the other tab

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-08-21.at.22.44.37.mp4

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

… tab is focused. If it is then allow the regular execusion of JS, if not, block all JS execution in the Webview.
@Daniel-Cross Daniel-Cross self-assigned this Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@Daniel-Cross Daniel-Cross added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: dc69d9d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/29b7371c-241a-4ccd-a9e7-2fac2108b8a8

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Daniel-Cross Daniel-Cross changed the title made a change to the Browser Tab component that checks if the webview… fix: Browser dialog prompts in app Aug 2, 2024
@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: a028cda
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/03bad0ab-a0dc-4e20-90f0-1b318f4bebdb

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 12, 2024
Copy link
Contributor

github-actions bot commented Aug 12, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e024750
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/83f79684-00c5-4f50-95fc-5996638d27db

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Daniel-Cross Daniel-Cross marked this pull request as ready for review August 12, 2024 21:58
@Daniel-Cross Daniel-Cross requested a review from a team as a code owner August 12, 2024 21:58
…ndling it inside the component. Also added some unit tests
@Daniel-Cross Daniel-Cross removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Aug 13, 2024
Copy link
Contributor

github-actions bot commented Aug 27, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ad42703
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8edff0fe-c25e-401b-b649-2f49427d91a6

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 27, 2024
Copy link
Contributor

github-actions bot commented Aug 27, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 276b154
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/74c9b2e8-0d70-4048-802f-d866c46ca5a0

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.

Project coverage is 52.71%. Comparing base (d95e1fc) to head (276b154).
Report is 16 commits behind head on main.

Files Patch % Lines
app/components/Views/BrowserTab/index.js 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10540      +/-   ##
==========================================
+ Coverage   52.60%   52.71%   +0.10%     
==========================================
  Files        1530     1533       +3     
  Lines       36709    36802      +93     
  Branches     4313     4338      +25     
==========================================
+ Hits        19312    19399      +87     
+ Misses      16086    16084       -2     
- Partials     1311     1319       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tommasini
tommasini previously approved these changes Aug 27, 2024
Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM! After addressing the chain id for hexadecimal values, this looks good to me!

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 28, 2024
Copy link
Contributor

github-actions bot commented Aug 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 8c59f7f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/801d0e33-ce8c-49b4-bcd5-9ec9c0366972

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Aug 29, 2024

@Daniel-Cross Daniel-Cross merged commit c8d2622 into main Aug 29, 2024
34 checks passed
@Daniel-Cross Daniel-Cross deleted the 1247-bug-browser-dialog-prompts-can-overlay-outside-of-tab branch August 29, 2024 10:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 29, 2024
@metamaskbot metamaskbot added the release-7.31.0 Issue or pull request that will be included in release 7.31.0 label Aug 29, 2024
@Daniel-Cross Daniel-Cross restored the 1247-bug-browser-dialog-prompts-can-overlay-outside-of-tab branch October 1, 2024 15:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.31.0 Issue or pull request that will be included in release 7.31.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants