Background of the issue:
I am working on optimizing the HGF real estate site and have improved the staging site significantly. However, Google's PageSpeed Insights indicates that the Browser Re-direct application in WPML is causing issues. I believe this is due to the detection of browser languages and redirecting visitors to the relevant language. You can see the issue by running the URL hidden link in hidden link.
Symptoms:
PageSpeed Insights is complaining about the use of legacy JS in the Browser Re-direct script, which is reducing the mobile score to below 90.
Questions:
How can I resolve the issue of legacy JS in the Browser Re-direct script?
Is there a way to modernize the application to improve PageSpeed scores?
Unfortunately the thing is, as you can see in the Google message, that adjusting this code would then make it work only for modern browsers, but we need to be able to support all browser out there and clients using.
On the other hand, using browser redirect can cause issue with SEO and Google indexing, so if not really mandatory for your case, maybe best would be to disable it.