[Bug 350693] "Character Encoding" in "View Source" window doesn't work p=Simon Montagu <smontagu@smontagu.org>, r=neil, sr=mscott, approval1.9=mtschrep

This commit is contained in:
mkmelin+mozilla@iki.fi 2008-05-09 13:38:49 -07:00
parent 56d93460ca
commit 0d4bb0ef56

View File

@ -181,12 +181,16 @@ function viewSource(url)
}
if (loadFromURL) {
// We need to set up session history to give us a page descriptor.
//
var webNavigation = getBrowser().webNavigation;
webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"].createInstance();
//
// Currently, an exception is thrown if the URL load fails...
//
var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
var viewSrcUrl = "view-source:" + url;
getBrowser().webNavigation.loadURI(viewSrcUrl, loadFlags, null, null, null);
webNavigation.loadURI(viewSrcUrl, loadFlags, null, null, null);
}
//check the view_source.wrap_long_lines pref and set the menuitem's checked attribute accordingly