View Source in Konqueror

Posted in:

I found a quick way of doing “View Source” in Konqueror. The built-in way opens your text editor, which isn't instant in my case (I have it configured to use Kate, which is great if I'm actually going to edit something, but usually I just want a quick peek, and I want it to be instant).

The trick is to use the following bookmarklet:

javascript:void (function(){c=unescape(document.documentElement.innerHTML); c=c.replace(/&/g,'&amp;'); c=c.replace(/</g,'&lt;'); c=c.replace(/>/g,'&gt;'); x=window.open('');x.document.write('<html><head><title>Source of Page<\/title><\/head><body bgcolor=\'#ffffcc\'><pre>' + c + '\n<\/pre><\/body><\/html>');x.document.close();return false;})();

You can use bookmarklets in Konqueror via 'Minitools' – it's quick and convenient, but so badly documented that I only just found out about it. The page's source is opened in a new window.

Comments §

Comments should load when you scroll to here...