Search Unity

Is there any way to suppress the error alerts on WebGL builds?

Discussion in 'Web' started by ravishnair, Sep 18, 2018.

  1. ravishnair

    ravishnair

    Joined:
    Aug 8, 2016
    Posts:
    20
    I am trying to incorporate an ad SDK into a WebGL project. It works fine except for throwing a Uncaught DOMException about the cross-reference origin problem.

    This is fine. When we go past the error thrown, the project works as expected. Clicking the OK button on the alert takes us past this point. The only problem is that the alert itself is jarring and not a good experience. And while I understand that the best option is to fix the exception, it is being thrown from the SDK developers side and working with them to get a fix for this is probably not an option.

    So, I was wondering if there was anyway to suppress the alert, while still having it show up in the console. I know that there is a window.onerror event handler that would stop an alert from being thrown when the return value is true, but 1) I tried doing that and it didn't work. That said, I may have put it in the wrong place or too late? 2) If there was another way to get around this, I wouldn't mind knowing that either!

    Thanks!
     
  2. ravishnair

    ravishnair

    Joined:
    Aug 8, 2016
    Posts:
    20