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

Widget Inspector values overlap label text in Brave browser #367

Closed
DanTup opened this issue Feb 27, 2019 · 15 comments
Closed

Widget Inspector values overlap label text in Brave browser #367

DanTup opened this issue Feb 27, 2019 · 15 comments
Labels
bug Something isn't working screen: inspector

Comments

@DanTup
Copy link
Contributor

DanTup commented Feb 27, 2019

Opened by @Sh1d0w at Dart-Code/Dart-Code#1487


Just updated to the latest version 2.24 and this is how it looks when I launch the Dart DevTools:

screenshot 2019-02-27 at 11 12 10

The widget attributes seems to overflow the widget name and everything becomes unreadable.

@Sh1d0w
Copy link

Sh1d0w commented Feb 27, 2019

After a short investigation it seems to be caused by the browser's built in ad-blocker. It prevents third party fingerprinting on the canvas element used, which seems to break the UI. After disabling this, everything looks good.

This issue can be closed I guess, thanks for the fast reaction 👍

@DanTup
Copy link
Contributor Author

DanTup commented Feb 27, 2019

caused by the browser's built in ad-blocker

Is this enabled by default? Which browser/version is it on which OS? It may be worth keeping this open to see if there's a way we can fix it, or at least warn users if they're using that browser.

@Sh1d0w
Copy link

Sh1d0w commented Feb 27, 2019

@DanTup I am on the latest version of MacOS using Brave Browser. Yes this is enabled by default.

@DanTup DanTup changed the title Widget Inspector values overlap label text Widget Inspector values overlap label text in Brave browser Feb 27, 2019
@jacob314
Copy link
Contributor

To keep our velocity high writing the devtools app we only have time to support Chrome. We should make that clearer when you start the app to avoid confusion.

@jacob314 jacob314 closed this as completed Mar 3, 2019
@DanTup
Copy link
Contributor Author

DanTup commented Mar 4, 2019

We should make that clearer when you start the app to avoid confusion.

Do you mean in the web app? Should we open an issue for this?

I had a quick look to see if there might be a quick fix for this, but it seems like Brave's anti-fingerprinting breaks quite a lot of stuff that uses canvas:

brave/brave-browser#1025

So I doubt there's something simple we could tweak to avoid it. I guess a lot of legit use looks like fingerprinting.

@kenzieschmoll
Copy link
Member

Open issue for warning users is here: #66.

@lookfirst
Copy link

lookfirst commented Jun 28, 2019

Super new Flutter user. Just ran into this myself. Having a warning for missing canvas would be nice.

image

@DanTup
Copy link
Contributor Author

DanTup commented Jul 8, 2019

@lookfirst Brave deliberately makes itself look like Chrome (it used to identify itself, but stopped because it was another variable that could be used for fingerprinting), so I don't think it's possible to show a warning for Brace without all Chrome users seeing it.

@Sh1d0w
Copy link

Sh1d0w commented Jul 8, 2019

I don’t think the warning should be based on browser detection, rather than if canvas is available. There are plugins from chrome that prevents fingerprinting as well, which then will result broken UI again.

@DanTup
Copy link
Contributor Author

DanTup commented Jul 9, 2019

Oh sorry, I may have misunderstood. I thought Brave was just messing with the rendering on the canvas. If it's just not available, then that might be easy to warn for.

Can you run this code in the JS console and confirm if it outputs false?

var elm = document.createElement('canvas'); !!(elm.getContext && elm.getContext('2d'));

@Sh1d0w
Copy link

Sh1d0w commented Jul 9, 2019

@DanTup That's close.

Canvas fingerprinting is well described here https://browserleaks.com/canvas#how-does-it-work

Because the way it works, the only way to prevent it is to disable toDataUrl method of the canvas, so the data can not be read, and thus no "fingerprint" can be obtained.

I think you can tweak the check like this:

var elm = document.createElement('canvas'); (elm.toDataURL() === '')

If fingerprinting is disabled, this will output true.

@DanTup
Copy link
Contributor Author

DanTup commented Jul 9, 2019

Ok, though we don't use toDataURL in DevTools so it might not be the best check. I wonder if it's measureText that's being blocked (looks like we use that to align the value, and the screenshot shows the value written over the label).

Does this return 0 for you?

document.createElement('canvas').getContext('2d').measureText('Text that is quite long')

@Sh1d0w
Copy link

Sh1d0w commented Jul 9, 2019

@DanTup Yep, the output is

TextMetrics {width: 0}

Good point.

I've just ran observatory with the latest version of Brave, as I wasn't using it for a while and found out a bunch of new problems:

Screenshot 2019-07-09 at 11 29 25

It seems like the CSS and JS assets are not served with correct mime type from the observatory thus white screen appears as those files are not loaded at all.

@DanTup
Copy link
Contributor Author

DanTup commented Jul 9, 2019

@Sh1d0w ok, then I think we can probably easily show a warning at the top of the Inspector page when measureString returns 0. I've opened #777.

As for the Observatory issue - I think that's best raised at dart-lang/sdk since it's a different app to the Dart DevTools (though I'm not sure what the support is intended to be for that).

@alexis-andino
Copy link

image

I turned off the shields for the website and the overlap issue was gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working screen: inspector
Projects
None yet
Development

No branches or pull requests

6 participants