rem: var docShellElement = document.getElementById("content"); docShellElement.docShell.viewMode = Components.interfaces.nsIDocShell.viewSource; 
add: catch(ex) { }  var docShellElement = document.getElementById("content-frame"); var docShell = docShellElement.docShell; docShell.viewMode = Components.interfaces.nsIDocShell.viewSource; var webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation); 
context: function viewSource(url){  if (!url)    return false; // throw Components.results.NS_ERROR_FAILURE;  try {    appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"]                        .createInstance(Components.interfaces.nsIBrowserInstance);    // Initialize browser instance..    appCore.setWebShellWindow(window);  } catch(ex) {    // Give up.    window.close();    return false;  }  var docShellElement = document.getElementById("content");  docShellElement.docShell.viewMode = Components.interfaces.nsIDocShell.viewSource;  try {    if ("arguments" in window && window.arguments.length >= 2) {      if (window.arguments[1].indexOf('charset=') != -1) {        var arrayArgComponents = window.arguments[1].split('=');        if (arrayArgComponents) {          docShellElement.markupDocumentViewer.defaultCharacterSet = arrayArgComponents[1];        }       }    }  } catch(ex) {  }  var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;  docShellElement.webNavigation.loadURI(url, loadFlags);  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/df6de48b4a029b719c9dcdfa023426810cfe6232/viewsource.js/buggy/suite/browser/viewsource.js