commit 7a0997b419789d73c38ebac7cc681ea9e6e6237c
parent 8421cc83eed9dd6c49a9eb61ef430984ed4d7c6f
Author: Mark Banner <standard8@mozilla.com>
Date: Mon, 20 Oct 2025 13:36:27 +0000
Bug 1993080 - Remove broken code for bookmarking place: uris. r=mak,places-reviewers
This code is incoorect and throws normally. It is only accessible from the star UI, which isn't a suitable place for allowing place: uris to be bookmarked.
Differential Revision: https://phabricator.services.mozilla.com/D267873
Diffstat:
1 file changed, 1 insertion(+), 36 deletions(-)
diff --git a/browser/components/places/PlacesUIUtils.sys.mjs b/browser/components/places/PlacesUIUtils.sys.mjs
@@ -1006,37 +1006,6 @@ export var PlacesUIUtils = {
},
/**
- * WARNING TO ADDON AUTHORS: DO NOT USE THIS METHOD. IT'S LIKELY TO BE REMOVED IN A
- * FUTURE RELEASE.
- *
- * Checks if a place: href represents a folder shortcut.
- *
- * @param {string} queryString
- * the query string to check (a place: href)
- * @returns {boolean} whether or not queryString represents a folder shortcut.
- * @throws if queryString is malformed.
- */
- isFolderShortcutQueryString(queryString) {
- // Based on GetSimpleBookmarksQueryFolder in nsNavHistory.cpp.
-
- let query = {},
- options = {};
- lazy.PlacesUtils.history.queryStringToQuery(queryString, query, options);
- query = query.value;
- options = options.value;
- return (
- query.folderCount == 1 &&
- !query.hasBeginTime &&
- !query.hasEndTime &&
- !query.hasDomain &&
- !query.hasURI &&
- !query.hasSearchTerms &&
- !query.tags.length == 0 &&
- options.maxResults == 0
- );
- },
-
- /**
* Helpers for consumers of editBookmarkOverlay which don't have a node as their input.
*
* Given a bookmark object for either a url bookmark or a folder, returned by
@@ -1073,11 +1042,7 @@ export var PlacesUIUtils = {
}
if (/^place:/.test(this.uri)) {
- if (this.isFolderShortcutQueryString(this.uri)) {
- return Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT;
- }
-
- return Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY;
+ throw new Error("Place URIs are not supported.");
}
return Ci.nsINavHistoryResultNode.RESULT_TYPE_URI;