mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 12:05:22 +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,13 +166,37 @@
|
||||
|
||||
function BrowserLoadURL()
|
||||
{
|
||||
appCore = XPAppCoresManager.Find("BrowserAppCore");
|
||||
if (appCore == null)
|
||||
{
|
||||
dump("BrowserAppCore has not been initialized\n");
|
||||
return;
|
||||
}
|
||||
|
||||
appCore = XPAppCoresManager.Find("BrowserAppCore");
|
||||
if (appCore == null) {
|
||||
dump("BrowserAppCore has not been initialized\n");
|
||||
return;
|
||||
}
|
||||
appCore.loadUrl(document.getElementById('urlbar').value);
|
||||
// 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);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user