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

Recovery passphrase truncated (canva's size) #76

Closed
chevdor opened this issue Nov 16, 2021 · 6 comments · Fixed by #77
Closed

Recovery passphrase truncated (canva's size) #76

chevdor opened this issue Nov 16, 2021 · 6 comments · Fixed by #77
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@chevdor
Copy link

chevdor commented Nov 16, 2021

image

@prybalko
Copy link
Contributor

prybalko commented Nov 16, 2021

Please provide more information, I'm not able to reproduce the issue.
What version of banana split are you using? Is it the one deployed on https://bs.parity.io or from master branch?
What OS and browser are you using?

@chevdor
Copy link
Author

chevdor commented Nov 16, 2021

I am using https://bs.parity.io and Brave Version 1.31.88 Chromium: 95.0.4638.69 (Official Build) (x86_64) on MacOS (Monterey).
I did download the html and opened it. I did not go offline but cheated for the test using:
image

The issues seems to be the width only. Could you share for reference a screenshot of how it looks like when it works ?

@prybalko
Copy link
Contributor

Here is how it looks to me.
Chromium 95.0.4638.69 (Official Build) Arch Linux (64-bit)

image

@chevdor
Copy link
Author

chevdor commented Nov 16, 2021

ok, so I miss a big chunk.
The canvas on my end is a fixed 30 pixels width which sounds definitely wrong.

@kirushik
Copy link
Contributor

@chevdor Brave returns zero from context.measureText call which is used to determine the appropriate canvas width in our component.
It is a well-known behavior intended to protect against browser fingerprinting, as documented in brave/brave-browser#1738

@prybalko probably we can detect measureText returning zero here, and fallback to some more sensible default than just 20px? I think privacy-conscious users would prefer the text being placed off-center in an ugly way over it not being visible at all.

@kirushik
Copy link
Contributor

@chevdor maybe you can test if Brave supports measuring text via DOM (like it is done here), so we can use it as a fallback for measuring it using the canvas API?

@prybalko prybalko self-assigned this Nov 17, 2021
@prybalko prybalko added this to To do in Roadmap via automation Nov 17, 2021
@prybalko prybalko moved this from To do to In progress in Roadmap Nov 17, 2021
@prybalko prybalko linked a pull request Nov 17, 2021 that will close this issue
@prybalko prybalko added the bug Something isn't working label Nov 17, 2021
@prybalko prybalko moved this from In progress to Review in progress in Roadmap Nov 17, 2021
Roadmap automation moved this from Review in progress to Done Nov 17, 2021
prybalko added a commit that referenced this issue Nov 17, 2021
* fix #76 add default passphrase canvas width

* add padLeft constant
@prybalko prybalko added this to the v0.3 milestone Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Roadmap
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants