Skip to content

Use browserExtension instead of relying on mimeTypes

To avoid the "double GET" problem when using WebEnginePart, whenever a http(s) URL needs to be opened, it's treated as if its mimetype were text/html so that it's handled by WebEnginePart. However, we only want to do this if the default html engine is WebEnginePart. This check is mainly handled by KonqRun::usingWebEnginePart(). What this function does is:

  • check whether the current part is a webengine part
  • if no current part exists, check the user preferences.

However, this behavior is incorrect because it doesn't take into account the possibility that the current part is a part which has nothing to do with the default web engine (for example, an Okular part). In this case, usingWebEnginePart would return false which would disable the "double GET" prevention mechanism.

To avoid this issue, I've changed how usingWebEnginePart works:

  • if the current part has a browserExtension, check its name
  • if there's no current part or it doesn't have a browserExtension, check the user preferences.

Merge request reports