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

Browser PoC: Safari Extension and Reborn #10684

Closed
1 of 9 tasks
sethkfman opened this issue Aug 16, 2024 · 5 comments
Closed
1 of 9 tasks

Browser PoC: Safari Extension and Reborn #10684

sethkfman opened this issue Aug 16, 2024 · 5 comments
Assignees
Labels
browser Related to web browser functionality, e.g. HTTP CORS, bookmarking, etc. team-mobile-platform

Comments

@sethkfman
Copy link
Contributor

sethkfman commented Aug 16, 2024

What is this about?

This issue is meant to prove out the idea that safari extensions can be utilized to communicate with the reborn browser with in the MetaMask mobile app.

Scenario

No response

Design

No response

Technical Details

  1. Understand if the Reborn browser can use Safari Extension
  1. Have a Reborn browser installed and try to use the extension
  2. Ideas for injecting SDK/Ethereum provider

Threat Modeling Framework

No response

Acceptance Criteria

  • Video demo of safari extension communicating with dapp site (can be console.logs)
  • If PoC, is not possible outline findings and any further steps or areas of investigation

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

@sethkfman sethkfman added team-mobile-platform browser Related to web browser functionality, e.g. HTTP CORS, bookmarking, etc. labels Aug 16, 2024
@sethkfman
Copy link
Contributor Author

@kylanhurt
Copy link
Contributor

kylanhurt commented Sep 11, 2024

We specifically used Javascript's alert function within a content.js file (within the web extension), as well as Javascript's console.log function to see whether our extensions's code was running on the webpage in each of the scenarios.

Basic repository code:
https://github.com/kylanhurt/mm-safari-ext

(Just clone and then open the folder up in XCode to run)

Findings:

  1. We were able to get a Safari web extension running on Safari on MacOS (desktop). Note that you may have to manually change Safari setting for extension to allow content script (in our case) to run on a specific website. Console logs and alert functionality worked fine.

  2. We were also able to get it to run in native Safari on iOS (mobile). Console logs and alert functionality worked fine.

  3. We were not able to get it to run correctly within react-native-inappbrowser-reborn inside of a React Native application. In fact, neither the alert nor the console.log code was executing

Following video shows alert functionality working on native Safari on iOS but not working from within MetaMask. I changed the button to just open up inappbrowser-reborn modal to chosen website.

RPReplay_Final1725907952.1.MP4

@gauthierpetetin
Copy link
Contributor

Next step: Ask on the Reborn repo if Reborn can support Safari extensions

@gauthierpetetin
Copy link
Contributor

It's actually already done here: proyecto26/react-native-inappbrowser#467

@sethkfman
Copy link
Contributor Author

sethkfman commented Sep 26, 2024

@kylanhurt Do you know if the PoC was done using an extension built and bundled in the metamask app or separate from it?

cc: @Gudahtt @andrepimenta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Related to web browser functionality, e.g. HTTP CORS, bookmarking, etc. team-mobile-platform
Projects
None yet
Development

No branches or pull requests

4 participants