For a given node, try asking the grap for the URL before falling back to using the node's ID. They might be different. REALLY!
git-svn-id: svn://10.0.0.236/trunk@40714 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b995e06247
commit
fc6441e09d
@ -415,7 +415,31 @@
|
||||
if (node.getAttribute('container') == "true") {
|
||||
return false;
|
||||
}
|
||||
url = node.getAttribute('id');
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
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)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:") {
|
||||
|
||||
@ -56,6 +56,30 @@ function OpenURL(event, node)
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
|
||||
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)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
|
||||
@ -415,7 +415,31 @@
|
||||
if (node.getAttribute('container') == "true") {
|
||||
return false;
|
||||
}
|
||||
url = node.getAttribute('id');
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
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)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:") {
|
||||
|
||||
@ -56,6 +56,30 @@ function OpenURL(event, node)
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
|
||||
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)
|
||||
{
|
||||
var Bookmarks = rdf.GetDataSource("rdf:bookmarks");
|
||||
if (Bookmarks)
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user