зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e28faabdd9
Коммит
310b849ef7
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче