mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Magical munging for IE Favorites and NetPositive (BeOS).
This commit is contained in:
parent
9cfbacbd6c
commit
c373460476
@ -56,23 +56,32 @@ function OpenURL(event, node)
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// first try asking RDF's graph for the URL
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
// add support for IE favorites under Win32, and NetPositive URLs under BeOS
|
||||
if (url.indexOf("file://") == 0)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = Bookmarks.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
|
||||
var fileSys = rdf.GetDataSource("rdf:files");
|
||||
if (fileSys)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = fileSys.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,12 +89,6 @@ function OpenURL(event, node)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
window.open(url,'bookmarks');
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
|
@ -56,23 +56,32 @@ function OpenURL(event, node)
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// first try asking RDF's graph for the URL
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
// add support for IE favorites under Win32, and NetPositive URLs under BeOS
|
||||
if (url.indexOf("file://") == 0)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = Bookmarks.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
|
||||
var fileSys = rdf.GetDataSource("rdf:files");
|
||||
if (fileSys)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = fileSys.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,12 +89,6 @@ function OpenURL(event, node)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
window.open(url,'bookmarks');
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user