Fixing Konqueror SFTP to HTML Pages

I recently did a system update and a few things quit working. One of them was viewing HTML pages over SFTP. I do this on a fairly regular basis because I have a separate development system where I do a lot of coding work. Part of this is looking at coverage reports that are output in HTML format. It's extremely handy to be able to just fire up Konqueror and view those files directly from the other system. Here's how I fixed it:

The problem is a bad file association. I'm not sure if this is an upgrade problem or a basic configuration problem in recent versions of KDE. Other things related to SFTP support have been broken in the not-so-distant past so it's conceivable that it's just a bug. I don't have a clean system to compare with, unfortunately.

Here were the steps I took to get it working again:

  • Click Settings -> Configure Konqueror
  • Navigate to File Management -> File Associations
  • Search for the application/x-extension-html type (yes, application. It's not a text type)
  • Click the Embedding tab
  • Select Show file in embedded viewer
  • In Services Preference Order, click Add..., select KHTML (khtml), click OK to add the service
  • You may want to repeat these steps for the application/x-extension-htm or other related types, depending on the types of files you want to open
  • Click OK on the configuration window to save changes

Now when you select an HTML file in the SFTP file browser it should open in the Konqueror embedded view instead of trying to open in an external browser (which, I should note, did work for the initial page but links didn't work due to lack of sftp:// protocol support in other browsers).