Rely on QtWebEngine to determine the mimetype of http(s) URLs
When KonqRun::scanFile is called from a view using a WebEnginePart and for a http or https URL with an unknown mimetype, don't use BrowserRun::scanFile but always return "text/html". This is because BrowserRun::scanFile issues a GET request to determine the mimetype, but QtWebEngine will then issue the same request, causing a double GET request. This way, instead, there will be only one GET request (from QtWebEngine). If QtWebEngine determines that the mimetype is one it can't open itself, the corresponding WebEnginePage will emit a openUrlRequest signal, with the real mimetype. Since the mimetype is now known, there isn't the risk of entering an endless loop. There are two problems: * the double GET request issue remains when the URL can't be displayed by QtWebEngine. QtWebEngine emits the downloadRequested signal after doing a GET request to determine the mimetype of the URL. Using KIO/KParts to download the file causes a second GET ...
Showing with 54 additions and 13 deletions