When the user tries to open a non-existing URL such as https://dsjiksfdakjf.com, Safari shows a built-in error page that displays texts like this:
Safari Can’t Find the Server
Safari can’t open the page “https://dsjiksfdakjf.com%E2%80%9D because Safari can’t find the server “dsjiksfdakjf.com”.
Can a Safari extension detect when this happen?
Background of question
I'd like to allow users to redirect from a broken or censored (HTTP 451) URL to another URL as a fallback, so that my users won't loose what they can still do other than just closing the tab.
I've been looking for the solution but so far, no luck. I couldn't find out such functionalities from SFSafariExtensionHandler, SFSafariPage, etc. JavaScript files of extensions are not loaded for that error page either. I even wonder if it actually can't detect and what I can do for now is just to submit the feedback to Apple...