mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-07 21:43:24 +00:00
Add failure detection when looking for "RDFCore" so that, if it can't be found or instantiated for some reason, normal URL loading via the location bar still functions.
This commit is contained in:
parent
a6d92d5ffc
commit
24259a3c42
@ -176,24 +176,32 @@
|
||||
// rjc: added support for URL shortcuts (3/30/1999)
|
||||
|
||||
// get RDF Core service
|
||||
var rdfCoreFound = false;
|
||||
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||
if (!rdfCore)
|
||||
if (rdfCore)
|
||||
{
|
||||
rdfCoreFound = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rdfCore = new RDFCore();
|
||||
if (!rdfCore)
|
||||
if (rdfCore)
|
||||
{
|
||||
return(false);
|
||||
rdfCore.Init("RDFCore");
|
||||
XPAppCoresManager.Add(rdfCore);
|
||||
rdfCoreFound = true;
|
||||
}
|
||||
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 != ""))
|
||||
if (rdfCoreFound == true)
|
||||
{
|
||||
document.getElementById('urlbar').value = shortcutURL;
|
||||
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