MystenLabs / walrus-sites

Walrus Sites: Decentralized Websites using Sui and Walrus.
https://docs.walrus.site/walrus-sites/intro.html
Apache License 2.0
10 stars 7 forks source link

Web Manifest icons are not loaded by Walrus Sites #90

Open kkomelin opened 3 weeks ago

kkomelin commented 3 weeks ago

After deploying my app to Walrus Sites https://suidappstarter.walrus.site/, I noticed an issue with loading PNG app icons, reported in the App Manifest section:

Screenshot from 2024-06-19 11-05-36

However, the PNG files are accessible directly.

Site: https://suidappstarter.walrus.site/ Web manifest: https://suidappstarter.walrus.site/webmanifest.json Icon: https://suidappstarter.walrus.site/android-chrome-192x192.png

giac-mysten commented 2 weeks ago

This is very interesting, thanks @kkomelin for the report.

The problem here seems to be that the browser loads the resources in the app manifest from outside the scope of the service worker. Unfortunately, this means that it will not be able to load the icons, because it is the service worker that communicates with Sui and Walrus and fetches the icon from the store.

I will think about it a bit more and ask around, but I think this may be a fundamental limitation of the "service-worker approach" to Walrus Sites. If/when we get around to creating a "server-side portal" (see the high level description in the documentation) this will surely work.

kkomelin commented 2 weeks ago

Thank you @giac-mysten. That's right. I will think about what we could do for a workaround too.

giac-mysten commented 2 weeks ago

Thanks! Please report back here if you find a satisfactory solution. I'll do the same :)