-
Notifications
You must be signed in to change notification settings - Fork 418
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: extension does not get injected on page load #1486
fix: extension does not get injected on page load #1486
Conversation
This is similar to how Talisman Wallet does injection: https://github.com/TalismanSociety/talisman/blob/6b49bf846bc5934f70e20e72e8fcaf5ac2c3343a/apps/extension/src/page.ts#L53 |
packages/extension/src/page.ts
Outdated
}); | ||
|
||
inject(); | ||
redirectIfPhishing(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The promise needs to be handled:
inject();
redirectIfPhishing().catch((e) => console.warn(`Unable to determine if the site is in the phishing list: ${(e as Error).message}`));
could work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be linted: yarn lint
, and the promise needs to be handled.
437f430
to
a74fe93
Compare
I just need to look into this more, I am not sure of the side affects - like what is the consequences of injecting before a redirect is established? It would nullify the return value (boolean) of the redirect |
I don't think it matter if a redirect happens. Because the user will no longer be on that page anyway. |
This looks ok to me, as redirecting would still be quick enough for users not to have time to interact with the website, but in 99.9% of the cases, when there's no redirect, it will save the time it takes to call the phishing api which was delaying the injection. |
Yea did some looking into the actual call stack happening, and I don't think there is any residual issues happening! Going to add this to the release that I cut today |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Resolves #1475