Fix bug that hitting ctrl+enter/shift+enter/ctrl+shift+enter to prepend/append to the urlbar url doesn't add that new url to the urlbar history.
git-svn-id: svn://10.0.0.236/trunk@133351 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
46dd489b6b
commit
5524e69ed1
@ -842,20 +842,6 @@ function BrowserLoadURL(aTriggeringEvent)
|
||||
if (url.match(/^view-source:/)) {
|
||||
BrowserViewSourceOfURL(url.replace(/^view-source:/, ""), null, null);
|
||||
} else {
|
||||
if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.ctrlKey && 'shiftKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.shiftKey)
|
||||
// Tack http://www. and .org on.
|
||||
url = gURLBar.value = "http://www." + url + ".org/";
|
||||
else if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.ctrlKey)
|
||||
// Tack www. and .com on.
|
||||
url = gURLBar.value = "http://www." + url + ".com/";
|
||||
else if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.shiftKey)
|
||||
// Tack www. and .org on.
|
||||
url = gURLBar.value = "http://www." + url + ".net/";
|
||||
|
||||
if (getBrowser().localName == "tabbrowser" &&
|
||||
aTriggeringEvent && 'altKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.altKey) {
|
||||
@ -1221,6 +1207,8 @@ function handleURLBarRevert()
|
||||
|
||||
function handleURLBarCommand(aTriggeringEvent)
|
||||
{
|
||||
canonizeUrl(aTriggeringEvent);
|
||||
|
||||
try {
|
||||
addToUrlbarHistory();
|
||||
} catch (ex) {
|
||||
@ -1231,6 +1219,26 @@ function handleURLBarCommand(aTriggeringEvent)
|
||||
BrowserLoadURL(aTriggeringEvent);
|
||||
}
|
||||
|
||||
function canonizeUrl(aTriggeringEvent)
|
||||
{
|
||||
if (!gURLBar)
|
||||
return;
|
||||
|
||||
if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.ctrlKey && 'shiftKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.shiftKey)
|
||||
// Tack http://www. and .org on.
|
||||
gURLBar.value = "http://www." + gURLBar.value + ".org/";
|
||||
else if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.ctrlKey)
|
||||
// Tack www. and .com on.
|
||||
gURLBar.value = "http://www." + gURLBar.value + ".com/";
|
||||
else if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent &&
|
||||
aTriggeringEvent.shiftKey)
|
||||
// Tack www. and .org on.
|
||||
gURLBar.value = "http://www." + gURLBar.value + ".net/";
|
||||
}
|
||||
|
||||
function UpdatePageProxyState()
|
||||
{
|
||||
if (gURLBar && gURLBar.value != gLastValidURLStr)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user