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

Changes to make the viewer to use viewsource: URL
r=valeski,sr=rpotts
This commit is contained in:
chak%netscape.com 2001-04-16 20:18:30 +00:00
Родитель b9342d088b
Коммит 81071aca50
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -742,10 +742,13 @@ nsViewerApp::ViewSource(nsString& aURL)
bw->SetApp(this); bw->SetApp(this);
bw->Init(mAppShell, nsRect(0, 0, 620, 400), PRUint32(~0), mAllowPlugins); bw->Init(mAppShell, nsRect(0, 0, 620, 400), PRUint32(~0), mAllowPlugins);
bw->mDocShell->SetViewMode(nsIDocShell::viewSource);
bw->SetTitle(NS_ConvertASCIItoUCS2("View Source").GetUnicode()); bw->SetTitle(NS_ConvertASCIItoUCS2("View Source").GetUnicode());
bw->SetVisibility(PR_TRUE); bw->SetVisibility(PR_TRUE);
bw->GoTo(aURL.GetUnicode());
nsAutoString strUrl; strUrl.AppendWithConversion("view-source:");
strUrl.Append(aURL);
bw->GoTo(strUrl.GetUnicode());
NS_RELEASE(bw); NS_RELEASE(bw);
return NS_OK; return NS_OK;