How to Load Unity WebGL Build Locally in a Chrome Extension?

23 views
Skip to first unread message

Awais iqbal

unread,
Nov 18, 2024, 12:44:32 PM11/18/24
to WebGL Dev List

Hi,

I’m building a Chrome extension that integrates a Unity WebGL build. Instead of hosting the WebGL files remotely, I want to keep them within the extension's assets for faster loading and offline access.

I’ve added the WebGL files (.loader.js, .framework.js, .data, .wasm) to the extension and am using an iframe to load an HTML file that initializes Unity. However, the Unity loader throws errors when trying to fetch the .data and .wasm files, likely due to Chrome’s security policies.

How can I configure my extension to load these files locally? Are there specific manifest.json settings or paths I need to use?

Thanks in advance!

Reply all
Reply to author
Forward
0 new messages