Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question I want to disable all alert errors for webgl

Discussion in 'Web' started by dansav, Oct 22, 2023.

  1. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    499
    I want to disable the entire alert system that shows up with:
    An error occurred running the Unity content on this page.

    I'm using unity 2022.

    I tried disabling the alert in a unityloader.js file I found in the webgl build folder but that didn't work.
    I also tried this but it didn't work either. I cleared my cache in my testing also.
    Code (CSharp):
    1. UnityLoader.Error.handler = function(e,t){console.log(e);}
    I'm not sure where it's even coming from in 2022.
    Can someone tell me where the alert is coming from so I can change it to console.log?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,271
    The proper way to do that is to locate and fix these errors. ;)