Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Подробнее

Is there a way (code) to open a single bookmark folder, if not why isn't there?

  • 1 ответ
  • 1 имеет эту проблему
  • 11 просмотров
  • Последний ответ от cor-el

more options

I been scouring the net and MDC and other Firefox pages looking for code that will open a desire bookmark folder under the bookmark menu. Someone told there is no code for that. Is or isn't there a code.

I know the code to open the main Bookmark folder.

PlacesCommandHook.showPlacesOrganizer('AllBookmarks');


or

document.getElementById('bookmarksShowAll')


I can bookmark to a single folder too.


var bmService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].

 getService(Components.interfaces.nsINavBookmarksService);

var ioService = Components.classes["@mozilla.org/network/io-service;1"].

 getService(Components.interfaces.nsIIOService);

var folder; folder = bmService.bookmarksMenuFolder; // Bookmarks Menu folder = bmService.getChildFolder(folder, "*Your Folder Name Here*"); var uri = ioService.newURI(content.document.location.href, null, null); var title = content.document.title; bmService.insertBookmark(folder, uri, bmService.DEFAULT_INDEX, title);


Yet not open a single folder directly with code.

I been scouring the net and MDC and other Firefox pages looking for code that will open a desire bookmark folder under the bookmark menu. Someone told there is no code for that. Is or isn't there a code. I know the code to open the main Bookmark folder. PlacesCommandHook.showPlacesOrganizer('AllBookmarks'); or document.getElementById('bookmarksShowAll') I can bookmark to a single folder too. var bmService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]. getService(Components.interfaces.nsINavBookmarksService); var ioService = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var folder; folder = bmService.bookmarksMenuFolder; // Bookmarks Menu folder = bmService.getChildFolder(folder, "'''*Your Folder Name Here*'''"); var uri = ioService.newURI(content.document.location.href, null, null); var title = content.document.title; bmService.insertBookmark(folder, uri, bmService.DEFAULT_INDEX, title); Yet not open a single folder directly with code.

Все ответы (1)

more options

Did you try to replace "AllBookmarks" with another folder name?

PlacesCommandHook.showPlacesOrganizer('BookmarksMenu');
PlacesCommandHook.showPlacesOrganizer('BookmarksToolbar');
PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');

Изменено cor-el