Das Skript hat die Nebenwirkung, dass sich Lesezeichen innerhalb des Menüs nicht verschieben lassen. Folgendes Skript funktioniert einwandfrei:
(function() {
if (location != 'chrome://browser/content/places/bookmarkProperties2.xhtml')
return;
const menuGuid = PlacesUtils.bookmarks.menuGuid;
let bookmarksService = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]
.getService(Ci.nsINavBookmarksService);
let observer = {
onItemMoved: (a1, a2, a3, a4, newIndex, a6, guid, a8, newParentGuid, a10, a11) => {
if (newParentGuid == menuGuid && newIndex != 0) {
PlacesUtils.bookmarks.moveToFolder([guid], menuGuid, 0);
};
}
};
bookmarksService.addObserver(observer, false);
window.addEventListener('unload', () =>
bookmarksService.removeObserver(observer)
);
})();
Alles anzeigen