Bug 1963590 - Fix isURILike with nsINavHistoryResultNodes. r=places-reviewers,mak

Differential Revision: https://phabricator.services.mozilla.com/D247898
This commit is contained in:
Moritz Beier
2025-05-12 17:01:31 +00:00
committed by mbeier@mozilla.com
parent 7bf26706d4
commit b27474929f

View File

@@ -941,13 +941,18 @@ export var PlacesUIUtils = {
},
/**
* Determines whether a node contains a uri
* Determines whether a node represents a URI.
*
* @param {nsINavHistoryResultNode | DOMElement} aNode A result node.
* @returns {boolean} whether the node contains a uri
* @param {nsINavHistoryResultNode | HTMLElement} aNode
* A result node.
* @returns {boolean}
* Whether the node represents a URI.
*/
isURILike(aNode) {
return lazy.PlacesUtils.nodeIsURI(aNode) || !!aNode.uri;
if (aNode instanceof Ci.nsINavHistoryResultNode) {
return lazy.PlacesUtils.nodeIsURI(aNode);
}
return !!aNode.uri;
},
/**