GWT unsupported browser warning

I want to display a message to users with unsupported browsers, as opposed to the fact that the site fails.

What is the best way to do this?

+4
source share
4 answers

The GWT team does not provide a list of unsupported browsers, only supported browsers, and this is an undefined list in the "most recent versions of Internet Explorer, Firefox and Safari" (Opera also in most cases). "

If you have a good idea that the browser / version will not work, you can use this code :

public static native String getUserAgent() /*-{ return navigator.userAgent.toLowerCase(); }-*/ 

to find out which browser is being used, and possibly prepare a workflow.

On the other hand, rendering web pages in a browser can fail in many subtle ways, ranging from mild annoyance to a catastrophic situation, and often there is no way to find out where your page falls on this scale. One of the main reasons for GWT is that you can stop worrying about it. At least until that happens.

+1
source

GWT also provides browser detection using the .gwt.xml file. Look at this:

http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideDeferredBindingReplacement

This is an interesting solution, but I'm not sure if this is the best solution in your case. This can be very useful for creating a simplified version of your application that will automatically load into unsupported browsers.

+2
source

If you want to make it simple and stupid, check with the javascript code in the main html file before loading GWT. However, I would rather trust GWT to handle things more or less quirky. You can also just recommend chrome or firefox.

0
source

I understand that this is an old question, but I had the same problem, and I wanted to share a new solution with it.

Today with outdated GWT2.7 browsers, try downloading undefined.cache.js . This clearly fails, and the client is stuck forever.

You can fix GWT itself by setting the backup steps, but the simple solution is to simply provide (manually created) undefined.cache.js and place it where other generated files are located.

Inside you put this line:

 xxxxxxx.onScriptDownloaded(alert('This browser is not supported anymore.\nPlease upgrade to a more recent browser.')); 

where xxxxxxx is your base name for your module (from xxxxxxxx.gwt.xml ).

0
source

Source: https://habr.com/ru/post/1285855/


All Articles