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

In Brave (Chromium based) the extension loads fonts with moz-extension: URLs, failing #163

Open
Siderite opened this issue May 29, 2023 · 5 comments · May be fixed by #169
Open

In Brave (Chromium based) the extension loads fonts with moz-extension: URLs, failing #163

Siderite opened this issue May 29, 2023 · 5 comments · May be fixed by #169
Labels
bug Something isn't working

Comments

@Siderite
Copy link

In Brave (Chromium based) the extension loads fonts with moz-extension: URLs, failing:

Refused to load the font 'moz-extension://epgnobcgnmchnhgkgpedebbmhbblfcob/fonts/RedHatText-Regular.ttf' because it violates the following Content Security Policy directive: "font-src 'self' lichess1.org".

@kieferro
Copy link
Member

Thanks for pointing that out, but that's simply because the extension needs to work for both Firefox and Chrome, and trying to load the Firefox variant fails in Chromium-based browsers. However, this should not change anything about the functionality.

I guess there should also be a way to unify this. Is the message somehow annoying or is there a limitation in functionality? Otherwise, you can just ignore it.

@Siderite
Copy link
Author

Siderite commented Jun 1, 2023

I am working on an extension as well and I have dev tools open all the time. And I see those errors, I think they're mine :D It doesn't affect functionality, but it is the only error in the console. BTW, great work on the extension.

@kieferro
Copy link
Member

kieferro commented Jun 1, 2023

And I see those errors, I think they're mine :D

I see 😄. I will see if I can do something about that without breaking anything.

BTW, great work on the extension.

Thanks, glad you like it.

@LofhJann
Copy link
Contributor

LofhJann commented Jun 14, 2023

This issue is also present in Google Chrome (up-to-date version "Version 114.0.5735.134 (Official Build) (64-bit)")

Nothing's breaking but 8 error logs load up on every refresh.

Cleanest way could be splitting the extension to 2 different releases for Mozilla and Chrome respectively having their own releases with only necessary files. This would make maintenance more fuzz but would enable making small browser specific fixes that aren't possible without writing if-spaghetti in current form. Maybe even split browser specific stuff from styles.css to child-styles.css files and have github actions build them on published versions?

EDIT: Upon little investigation seems that Chrome and Firefox both support unified format for loading local fonts as used in my PR below. Leaving this comment here in any case since should further cross-browser problems arise splitting to two releases would still be worth considering in future

@LofhJann LofhJann linked a pull request Jun 14, 2023 that will close this issue
@kieferro
Copy link
Member

@LofhJann Yes, maybe at some point we have to split the versions. But in any case where it can be avoided (and your PR shows that this is such a case - thanks), I would like to avoid it.

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants