diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js index 3ba72059a1a3..46b9baffa18b 100644 --- a/suite/browser/navigator.js +++ b/suite/browser/navigator.js @@ -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:") { diff --git a/suite/common/bookmarks/bookmarks.js b/suite/common/bookmarks/bookmarks.js index 9312f4d428ef..c62f6c07aa67 100644 --- a/suite/common/bookmarks/bookmarks.js +++ b/suite/common/bookmarks/bookmarks.js @@ -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:") { diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 3ba72059a1a3..46b9baffa18b 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -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:") { diff --git a/xpfe/components/bookmarks/resources/bookmarks.js b/xpfe/components/bookmarks/resources/bookmarks.js index 9312f4d428ef..c62f6c07aa67 100644 --- a/xpfe/components/bookmarks/resources/bookmarks.js +++ b/xpfe/components/bookmarks/resources/bookmarks.js @@ -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:") {