What’s the official way to customise the “Unsupported browser” page to display a message of my own choosing?
Hi,
I don’t know about official, but generally what you can do is replacing the [UnsupportedBrowserHandler
]
(https://github.com/vaadin/framework/blob/master/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java) with a new implementation. One way would be adding it in a service init listener; see https://vaadin.com/api/framework/8.6.2/com/vaadin/server/VaadinServiceInitListener.html and https://vaadin.com/api/framework/8.6.2/com/vaadin/server/ServiceInitEvent.html#addRequestHandler-com.vaadin.server.RequestHandler-
. Handlers added last are executed first, so your new handler will take place before the one from the Framework.
Another approach for more or less the same would be a custom VaadinService
where you override the [createRequestHandlers
method]
(https://github.com/vaadin/framework/blob/master/server/src/main/java/com/vaadin/server/VaadinService.java#L270) to provide your custom UnsupportedBrowserHandler
implementation. Override createServletService
in your VaadinServlet
implementation to use your custom VaadinService
. This way you don’t need to run the Framework version of UnsupportedBrowserHandler at all (so for example you can loosen the browser requirements, but that’s on your own risk).
-Olli