thomersch / openstreetmap-calendar

osmcal, a Collaborative Calendar for OpenStreetMap-related Events
https://osmcal.org
Apache License 2.0
33 stars 9 forks source link

Question: Is SourceSansPro intentionally preloaded? #95

Closed danieldegroot2 closed 2 years ago

danieldegroot2 commented 2 years ago

Browser: Chrome

Dev console image

thomersch commented 2 years ago

Yes, it is. Though I am not sure whether that's a wise decision. Preloading can decrease load time, because those assets requests are multiplexed over http/2.

Do you have Source Sans Pro installed on your system? Because then the system one is picked why this message might pop up. Initially I added this mechanism to reduce transfer size if you already got the font, but then I added preload which defeats the purpose of the first mechanism.

Tangentially, I am always a bit torn about custom fonts: They are quite large, thus dragging the first load down. On the other hand, the default fonts on some environments are truly awful, and I want to have more control here.

danieldegroot2 commented 2 years ago

Doesn't look like it's installed on my system. I can see the text just fine btw.

Now also mentions request credentials image

thomersch commented 2 years ago

I can't make any sense from cross origin. It's coming from exactly the same domain. Also, I cannot reproduce it. Are you running some plugins that might interfere?

The complaint about the preload stuff only appears in Chrome, so I am a bit reluctant to change anything.

danieldegroot2 commented 2 years ago

Are you running some plugins that might interfere?

No. I don't have any issues seeing the text or font afaik, I only noticed I got these warnings in the dev console. This is what the site looks like for me (high dpi, can always cause issues ofc).

image image

thomersch commented 2 years ago

Apparently, the w3c mandates the crossorigin attribute on preloaded fonts, but Chrome seems to enforce this even for same-origin sources. From my reading, the specification mandates this only for CORS, but since this was an easy workaround for Chrome, I quickly pushed this out: 7b39115b88fb391a629236cffbc89ca164f7e290