rem:  try { createBrowserInstance(); if (appCore == null) {  dump("Giving up...\n"); window.close(); }   appCore.setWebShellWindow(window); if ( window._content ) { dump("Setting content window\n"); appCore.setContentWindow( window._content ); } }  catch(ex) { dump("Failed to create and initialiaze the AppCore...\n"); }  var docShellElement = document.getElementById("content-frame"); var docShell = docShellElement.docShell; docShell.viewMode = Components.interfaces.nsIDocShell.viewSource; var webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);  try { if ( window.arguments && window.arguments[1] ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); appCore.SetDocumentCharset(arrayArgComponents[1]); } } } } }  catch(ex) { dump("*** Failed to SetDocumentCharset...\n"); }  var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE; webNav.loadURI(window.arguments[0], loadFlags); 
add: viewSource(window.arguments[0]); 
context: function onLoadViewSource() {    try {        createBrowserInstance();        if (appCore == null) {            // Give up.            dump("Giving up...\n");            window.close();        }        // Initialize browser instance..        appCore.setWebShellWindow(window);        if ( window._content ) {            dump("Setting content window\n");            appCore.setContentWindow( window._content );        }    }    catch(ex) {        dump("Failed to create and initialiaze the AppCore...\n");    }    var docShellElement = document.getElementById("content-frame");    var docShell = docShellElement.docShell;    docShell.viewMode = Components.interfaces.nsIDocShell.viewSource;    var webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);    try {        if ( window.arguments && window.arguments[1] ) {            if (window.arguments[1].indexOf('charset=') != -1) {                var arrayArgComponents = window.arguments[1].split('=');                if (arrayArgComponents) {                    if (appCore != null) {                      dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n");                      appCore.SetDocumentCharset(arrayArgComponents[1]);                    }                 }            }        }    }    catch(ex) {        dump("*** Failed to SetDocumentCharset...\n");    }    var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;    webNav.loadURI(window.arguments[0], loadFlags);}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/be05193ddf85b459a0e2181c6862df15f80e7dbe/viewsource.js/clean/suite/browser/viewsource.js