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(content): dispatch load event if wallet address is valid #367

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

raducristianpopa
Copy link
Member

@raducristianpopa raducristianpopa commented Jun 25, 2024

Context

Closes #365.

Changes proposed in this pull request

Initially I thought there was an error and the load event was not correctly dispatched. It looks like we omitted this. Now we dispatch the load event if the wallet address is valid.

Additional changes:

  • small refactoring for the wallet address check
  • update the checkWalletAddressUrlFormat function since we do not need to check for SPSP endpoints

@github-actions github-actions bot added the area: content Improvements or additions to extension content script label Jun 25, 2024
@raducristianpopa
Copy link
Member Author

raducristianpopa commented Jun 25, 2024

Extension builds preview

Name Link
Latest commit 7c7f142
Latest job logs Run #9661499904
BadgeDownload
BadgeDownload

@raducristianpopa raducristianpopa marked this pull request as ready for review June 25, 2024 11:22
src/content/utils.ts Show resolved Hide resolved
`SPSP endpoint must be specified as ${spec}fully resolved https:// url, ` +
`got ${JSON.stringify(pointerOrUrl)} `
url = new URL(walletAddressUrl)
if (url.protocol !== 'https:') {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (url.protocol !== 'https:') {
if (!ALLOWED_PROTOCOLS.includes(url.protocol)) {

Copy link
Member Author

Choose a reason for hiding this comment

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

The wallet address should always be served under https:.

Copy link
Member

Choose a reason for hiding this comment

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

I meant if in dev we want to use a localhost Rafiki.

@raducristianpopa raducristianpopa merged commit 9b5a67f into main Jun 26, 2024
8 checks passed
@raducristianpopa raducristianpopa deleted the rp/365/trigger-load-event branch June 26, 2024 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: content Improvements or additions to extension content script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Load event not being triggered
2 participants