I'm deploying a kiosk system that uses Chrome to display a java web app running in jetty started with a windows service wrapper. It takes some time after the system starts for jetty to be ready to serve content so for now I have a wait occurring which then launches Chrome in kiosk mode. This is pretty ugly, unreliable and slow.
What I'm trying to do in order to make it run smoother is to use a Chrome extension that detects the 4xx error and sets a timeout that reloads the page. I have this working as is but it's still an ugly solution since the page is refreshing every 3 seconds and it's the "Oops! Google Chrome could not find..." page that's showing to the user while they're waiting. I can fix the first problem with an ajax request in the background to detect when the page is ready but I really want to show the user a nice "Loading" screen instead of the error page. I'm not a Chrome extension developer and all of my attempts to fix this with an extension have failed so far.
I thought it would be possible to customize the error page but I can't find any information on how to do that since all of the search results I find on the topic center around the 512 minimum size issue.
You can customize the error page with
webNavigation API
. Add an event Listener for onErrorOccurred event and update relevant details.Check sample code as a reference.
Demonstration
manifest.json
Registered background page and added all relevant permissions to manifest file.
background.js
Redirected to our custom Page in case of any error, you can customize this to desired level.
page.html
Some trivial code
Reference
Go to options, privacy settings, and uncheck the box:
"Use a web service to help resolve navigation errors"
Detailed instructions here.