diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js index b0950354b1d..bdc4317735c 100644 --- a/mozilla/browser/app/profile/firefox.js +++ b/mozilla/browser/app/profile/firefox.js @@ -434,3 +434,6 @@ pref("bidi.browser.ui", false); // 1 act like PgUp/PgDown // 2 and other values, nothing pref("browser.backspace_action", 0); + +pref("view_source.editor.path", ""); +pref("view_source.editor.external", false); diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index 166aa94192f..6f6e966c311 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -1932,12 +1932,11 @@ function readFromClipboard() function BrowserViewSourceOfDocument(aDocument) { - var docCharset; var pageCookie; var webNav; // Get the document charset - docCharset = "charset=" + aDocument.characterSet; + var docCharset = "charset=" + aDocument.characterSet; // Get the nsIWebNavigation associated with the document try { @@ -1973,16 +1972,17 @@ function BrowserViewSourceOfDocument(aDocument) // If no page descriptor is available, just use the view-source URL... } - BrowserViewSourceOfURL(webNav.currentURI.spec, docCharset, pageCookie); + ViewSourceOfURL(webNav.currentURI.spec, pageCookie, aDocument); } -function BrowserViewSourceOfURL(url, charset, pageCookie) +function ViewSourceOfURL(aURL, aPageDescriptor, aDocument) { - // try to open a view-source window while inheriting the charset (if any) - openDialog("chrome://global/content/viewSource.xul", - "_blank", - "scrollbars,resizable,chrome,dialog=no", - url, charset, pageCookie); + if (getBoolPref("view_source.editor.external", false)) { + gViewSourceUtils.openInExternalEditor(aURL, aPageDescriptor, aDocument); + } + else { + gViewSourceUtils.openInInternalViewer(aURL, aPageDescriptor, aDocument); + } } // doc - document to use for source, or null for this window's document diff --git a/mozilla/browser/base/content/global-scripts.inc b/mozilla/browser/base/content/global-scripts.inc index c34cb30d152..4057e7f2eef 100644 --- a/mozilla/browser/base/content/global-scripts.inc +++ b/mozilla/browser/base/content/global-scripts.inc @@ -46,3 +46,4 @@