mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
Bugzilla Bug 78619 View-source: pages have a view source option
[Remove view source option] patch by bzbarsky@mit.edu r=timeless sr=alecf
This commit is contained in:
parent
d06a250b8e
commit
a1a7753655
@ -811,8 +811,12 @@ function loadURI(uri)
|
||||
function BrowserLoadURL()
|
||||
{
|
||||
var url = gURLBar.value;
|
||||
loadURI(getShortcutOrURI(url));
|
||||
_content.focus();
|
||||
if (url.match(/^view-source:/)) {
|
||||
BrowserViewSourceOfURL(url.replace(/^view-source:/, ""), null);
|
||||
} else {
|
||||
loadURI(getShortcutOrURI(url));
|
||||
_content.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function getShortcutOrURI(url)
|
||||
@ -899,11 +903,16 @@ function BrowserViewSource()
|
||||
if (focusedWindow)
|
||||
var docCharset = "charset=" + focusedWindow.document.characterSet;
|
||||
|
||||
//now try to open a view-source window while inheriting the charset (if any)
|
||||
BrowserViewSourceOfURL(_content.location, docCharset);
|
||||
}
|
||||
|
||||
function BrowserViewSourceOfURL(url, charset)
|
||||
{
|
||||
// try to open a view-source window while inheriting the charset (if any)
|
||||
openDialog("chrome://navigator/content/viewSource.xul",
|
||||
"_blank",
|
||||
"scrollbars,resizable,chrome,dialog=no",
|
||||
_content.location, docCharset);
|
||||
url, charset);
|
||||
}
|
||||
|
||||
// doc=null for regular page, doc=owner document for frame.
|
||||
|
Loading…
Reference in New Issue
Block a user