Keyboard Shortcut to Create New Folder in Library?

User Help for Mozilla Firefox
Post Reply
thechamlin
Posts: 295
Joined: June 13th, 2005, 8:47 pm

Keyboard Shortcut to Create New Folder in Library?

Post by thechamlin »

I have deleted tons of bookmarks and am reorganizing what's left. Need to make quite a few new folders/subfolders. Is there a keyboard shortcut to use when in the Library/bookmark manager?
morat
Posts: 6427
Joined: February 3rd, 2009, 6:29 pm

Re: Keyboard Shortcut to Create New Folder in Library?

Post by morat »

Here is a code snippet to create a temporary shortcut in the library window.

Command: New Folder
Shortcut: F1

Code: Select all

(function () {
  var win = Services.wm.getMostRecentWindow("Places:Organizer");
  if (win) {
    var keyset = win.document.getElementById("placesOrganizerKeyset");
    var key = win.document.createXULElement("key");
    key.setAttribute("id", "__unique_identifier_key_new_folder");
 // key.setAttribute("key", "A"); // A
 // key.setAttribute("modifiers", "control,shift"); // Ctrl+Shift
 // key.setAttribute("modifiers", "alt"); // Alt
    key.setAttribute("keycode", "VK_F1"); // F1
    key.setAttribute("command", "placesCmd_new:folder");
    keyset.appendChild(key);
  } else {
    var win = Services.wm.getMostRecentWindow("navigator:browser");
    win.alert("The library window is not opened.");
  }
})();
Browser Console command line
http://developer.mozilla.org/docs/Tools ... mmand_line

Reference
view-source:chrome://browser/content/places/places.xul

P.S.

You can import the bookmarks.html file to create the new folders.

* bookmarks.html

Code: Select all

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
  <DT><H3>Alpha</H3>
  <DL><p>
    <DT><H3>Beta</H3>
    <DL><p>
      <DT><A HREF="http://en.wikipedia.org/">Wikipedia</A>
    </DL><p>
    <DT><A HREF="http://en.wikipedia.org/wiki/1">1</A>
    <DT><A HREF="http://en.wikipedia.org/wiki/2">2</A>
    <DT><A HREF="http://en.wikipedia.org/wiki/3">3</A>
  </DL><p>
</DL>
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Re: Keyboard Shortcut to Create New Folder in Library?

Post by dickvl »

Note that in Firefox 73 this will be places.xhtml
chrome://browser/content/places/places.xhtml

https://dxr.mozilla.org/mozilla-release ... places.xul
https://dxr.mozilla.org/mozilla-central ... aces.xhtml
thechamlin
Posts: 295
Joined: June 13th, 2005, 8:47 pm

Re: Keyboard Shortcut to Create New Folder in Library?

Post by thechamlin »

Thanks, all!
Post Reply