mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
Bug 252317 Ensure view source has a page descriptor it can reload r=doron sr=bz
This commit is contained in:
parent
b139a74a1c
commit
fd737bf4b3
@ -164,12 +164,17 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user