Page MenuHomePhabricator

[Cashtab] [extension address passing p10] Add a prompt for the user to approve or deny the address request
ClosedPublic

Authored by bytesofman on Oct 21 2022, 17:54.

Details

Summary

T2550

Depends on D12323

Instead of automatically passing the address when a web page requests, first open the extension as a pop-up and prompt the user for approval.

Two reasons to do this.

  1. Some users may not wish to share their address with some web pages
  2. This makes sure the extension opens (and saves address to extension storage) even if the user is running the latest version for the first time, preventing the previous 'undefined' error
Test Plan
cd web/cashtab
npm run extension
cd web/cashtab-components
npm run storybook

Navigate to brave://extensions and click Update
Click 'Get Address' in the GetAddress component. A popup should appear in top right of screen. It should tell you the origin of the requesting page.
Click "OK" and note that the address is populated.
Click 'Get Address' again. Click "Cancel" and note the address is populated by "Address request denied by user.'

Event Timeline

Making tab communication more robust by specifying and communicating tab id

emack requested changes to this revision.Oct 25 2022, 23:42
emack added a subscriber: emack.


Clicking on the Get Address component is triggering the extension all ok however I'm not seeing the approval modal. I've double checked this is the right extension version as seen via the console log in the background. I'm using Chrome v105.0.5195.102.

This revision now requires changes to proceed.Oct 25 2022, 23:42


Clicking on the Get Address component is triggering the extension all ok however I'm not seeing the approval modal. I've double checked this is the right extension version as seen via the console log in the background. I'm using Chrome v105.0.5195.102.

Could you "inspect view" on the popup and let me know what is showing up in that dev console?

I'm not able to recreate this with Chrome Version 106.0.5249.119 (Official Build) (64-bit), also using a new / empty wallet

It's working now. The issue was caused by having the storybook running in the background whilst rebuilding the extension instance. Need to start both cleanly and sequentially.

This revision is now accepted and ready to land.Oct 27 2022, 01:13