mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
Add support for "Shortcut URLs". Basically, anything entered into the location bar is first checked to see if it maps to a bookmarked URL and, if so, the real URL is put into the location bar and then loaded.
This commit is contained in:
parent
1afeea43ce
commit
a6d92d5ffc
@ -166,12 +166,36 @@
|
|||||||
|
|
||||||
function BrowserLoadURL()
|
function BrowserLoadURL()
|
||||||
{
|
{
|
||||||
|
|
||||||
appCore = XPAppCoresManager.Find("BrowserAppCore");
|
appCore = XPAppCoresManager.Find("BrowserAppCore");
|
||||||
if (appCore == null) {
|
if (appCore == null)
|
||||||
|
{
|
||||||
dump("BrowserAppCore has not been initialized\n");
|
dump("BrowserAppCore has not been initialized\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rjc: added support for URL shortcuts (3/30/1999)
|
||||||
|
|
||||||
|
// get RDF Core service
|
||||||
|
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
rdfCore = new RDFCore();
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
rdfCore.Init("RDFCore");
|
||||||
|
XPAppCoresManager.Add(rdfCore);
|
||||||
|
}
|
||||||
|
var shortcutURL = rdfCore.findBookmarkShortcut(document.getElementById('urlbar').value);
|
||||||
|
|
||||||
|
dump("FindBookmarkShortcut: in='" + document.getElementById('urlbar').value + "' out='" + shortcutURL + "'\n");
|
||||||
|
|
||||||
|
if ((shortcutURL != null) && (shortcutURL != ""))
|
||||||
|
{
|
||||||
|
document.getElementById('urlbar').value = shortcutURL;
|
||||||
|
}
|
||||||
|
|
||||||
appCore.loadUrl(document.getElementById('urlbar').value);
|
appCore.loadUrl(document.getElementById('urlbar').value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user