WebGL Publisher ignore my index.html changes

Could someone help me out?
I’m working on building a Unity webGL app and I need to add some code in index.html. However, when I publish using the WebGL Publisher, I’m not seeing my changes. When I run it on my localhost, the index.html is triggered and I can see that my code is working.
I followed the instructions from here on how to add a custom index.html. I copied the default one and only added some logging for example.
In my build folder, the index.html page contains my changes from the template, but when I publish it, they never seem to execute.
I’m wondering if the WebGL Publisher is using some unique start page, or how I can overcome this problem. Any help would be appreciated.

WebGL Publisher will publish app on https://play.unity.com

1 Like

I didn’t use About WebGL Publisher | WebGL Publisher | 4.2.3, but I guess it generates files in the Library folder and upload from here.

Such way Asset Store Publishing Tools work.


Try to publish manually without building by uncheckning Auto-Publishing in Edit > Preferences > WebGL Publisher.

So:

  1. Build.
  2. Make Changes in HTML.
  3. Unity > Publish > WebGL Project.

Hi, sorry for the late respond.

I tried what you suggested but it did not help. In the built project index.html file is ok, with changes from the template.

Do you know how we can ask someone from Unity.

Because if I run the same build on the local host everything is working fine, all changes from index.html are there.

1 Like

On Unity Play, there is a link to discord: Struckd - Create, Share & Play Games

1 Like

Hmmm I wouldn’t be surprised if modifications to index.html are simply not supported on play.unity.com

This would be a major security hole since you could inject any custom Javascript in your custom index.html and run it on a domain that’s not yours. Naturally nobody will want their users to upload and run html files with custom javascript on their servers. This could have backfiring repercussions if attacks or any kind of malicious play were to originate from play.unity.com (eg domain blacklisted in malware tools or even search engines).