Bug 1439697 - Make the warning about attempting to move an unmovable places node be restricted to our own places flavors only. r?mak
MozReview-Commit-ID: 1zdVIIXWmYI
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -1164,29 +1164,33 @@ async function getTransactionsForTransfe
throw new Error(`Unsupported '${item.type}' data type`);
}
// Work out if this is data from the same app session we're running in.
if (!("instanceId" in item) || item.instanceId != PlacesUtils.instanceId) {
if (item.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
throw new Error("Can't copy a container from a legacy-transactions build");
}
+ // Only log if this is one of "our" types as external items, e.g. drag from
+ // url bar to toolbar, shouldn't complain.
+ if (PlacesUIUtils.PLACES_FLAVORS.includes(item.type)) {
+ Cu.reportError("Tried to move an unmovable Places " +
+ "node, reverting to a copy operation.");
+ }
// We can never move from an external copy.
canMove = false;
}
if (doMove && canMove) {
canMove = canMoveUnwrappedNode(item);
}
}
if (doMove && !canMove) {
- Cu.reportError("Tried to move an unmovable Places " +
- "node, reverting to a copy operation.");
doMove = false;
}
return doMove ? getTransactionsForMove(items, insertionIndex, insertionParentGuid) :
getTransactionsForCopy(items, insertionIndex, insertionParentGuid);
}
/**