GooseMod / OpenAsar

Open-source alternative of Discord desktop's app.asar
https://openasar.dev
GNU Affero General Public License v3.0
2.54k stars 67 forks source link

CSS importing #190

Closed Sp3EdeR closed 3 months ago

Sp3EdeR commented 3 months ago

Hello OpenAsar devs!

So OpenAsar has a custom CSS support, and there are many premade CSS packages from theming to adblocking on github. They usually support Vencord and Better Discord, and they usually go for the @import url(...) API to ensure that the CSS can update with the Discord client dynamically. It seems to me that this syntax does not work with OpenAsar. I think it would be a very handy function.

My best guess for the reason of this issue is that the @import url(...) must appear at the start of the entire CSS file, before any CSS declarations. So perhaps by updating the CSS injection point, it might work?

SmolAlli commented 3 months ago

image I can personally confirm that using import URLs does work My theme comes from one and I have a snippet. It has always worked without issue.

Sp3EdeR commented 3 months ago

Can you please provide the links so that I can test with your themes?

Sp3EdeR commented 3 months ago

I think I found the issue. When the CSS is hosted on github pages, it seems to work fine. But from raw.githubusercontent.com, it does not seem to send proper response headers, and so Discord refuses to load it. Sorry for misidentifying the issue and thanks for the help!