Fix for bug#66334 - Viewsource needs to be a protocol handler

Changes to make the mozilla to use viewsource: URL
r=valeski,sr=rpotts
This commit is contained in:
chak%netscape.com 2001-04-16 20:19:44 +00:00
parent 959f4ba1b8
commit 1a90cb3c8f

View File

@ -24,7 +24,6 @@ function viewSource(url)
}
var docShellElement = document.getElementById("content");
docShellElement.docShell.viewMode = Components.interfaces.nsIDocShell.viewSource;
try {
if ("arguments" in window && window.arguments.length >= 2) {
@ -39,7 +38,8 @@ function viewSource(url)
}
var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
docShellElement.webNavigation.loadURI(url, loadFlags);
var viewSrcUrl = "view-source:" + url;
docShellElement.webNavigation.loadURI(viewSrcUrl, loadFlags);
return true;
}