Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Mozilla Firefox - Manage Bookmarks - Default Folder

  • 7 réponses
  • 1 a ce problème
  • 32 vues
  • Dernière réponse par gtadamsesq

more options

Using Firefox version 99.0 (64bit). When I click "Bookmarks / Manage Bookmarks, the listing defaults to the "Other Bookmarks" folder. I would like it to default to the "Bookmarks Menu" folder. How do I make it do that?

Using Firefox version 99.0 (64bit). When I click "Bookmarks / Manage Bookmarks'', the listing defaults to the "Other Bookmarks" folder. I would like it to default to the "Bookmarks Menu" folder. How do I make it do that?

Solution choisie

You can use the autoconfig.cfg file in the Firefox installation folder to initialize (set/lock) preferences and run privileged JavaScript code. In this case code to open the Library with the Bookmarks Menu folder selected. You can modify the showPlaces variable to open any of the four possible root folders (in this case [1]).

To use Autoconfig, place two files into the Firefox installation directory.

  • on Windows and Linux, they go into the same directory where Firefox is installed
  • on macOS, they go into the Contents/Resources directory of the Firefox.app

The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults\pref" directory where the channel-prefs.js file is located.

The autoconfig.cfg file is placed at the top level of the Firefox directory.

  • autoconfig.cfg and autoconfig.js need to start with a comment line (//)
  • autoconfig.js needs to use Unix line endings (LF instead of CR/LF)

See also:


Content of autoconfig.js

 //
 pref("general.config.filename", "autoconfig.cfg");
 pref("general.config.obscure_value", 0);
 pref("general.config.sandbox_enabled", false); // disable sandbox to allow privileged JavaScript

Content of autoconfig.cfg

// first line in autoconfig.cfg is a comment line
try {
 let {classes:Cc, interfaces:Ci, manager:Cm, utils:Cu} = Components;
 const {Services} = Cu.import('resource://gre/modules/Services.jsm');
 function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
 ConfigJS.prototype = {
  observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
  handleEvent: function (aEvent) {
   let document = aEvent.originalTarget;
   let window = document.defaultView;
   let location = window.location;
   if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
    if (window._gBrowser) {
      let showPlaces = ["AllBookmarks","BookmarksMenu","BookmarksToolbar","UnfiledBookmarks"][1];
      elm = document.getElementById("Browser:ShowAllBookmarks");
      if (elm) {
       elm.setAttribute("oncommand", "PlacesCommandHook.showPlacesOrganizer('"+showPlaces+"')");
      }
    }
   }
  }
 };
 if (!Services.appinfo.inSafeMode) { new ConfigJS(); }
} catch(e) {Cu.reportError(e);}
Lire cette réponse dans son contexte 👍 1

Toutes les réponses (7)

more options

See the first few posts in the thread linked below. Evidently some users are now seeing this for the first time (also discussed in that thread).

https://support.mozilla.org/en-US/questions/1370627

Cela vous a-t-il été utile ?

more options

Thanks, but that doesn't answer my question.

Cela vous a-t-il été utile ?

more options

The archived article "How do I change the default save location for bookmarks back to bookmark menu?" advises installing the "Default Bookmark Folder Option" extension. That Extension works fine for getting a bookmark put at the bottom of the Bookmarks Menu, however, is doesn't make the "Bookmarks Menu " folder the default menu folder for SEARCHING bookmarks. When I click "Bookmarks / Manage Bookmarks" it still defaults to the "Other Bookmarks" folder. How do I make clicking "Bookmarks / Manage Bookmarks" default to the "Bookmarks Menu" folder?

Cela vous a-t-il été utile ?

more options

You can look for an extension like this on the Add-ons website.

Cela vous a-t-il été utile ?

more options

As I mentioned in my post, the "Default Bookmark Folder" Add On does not solve my stated problem.

Cela vous a-t-il été utile ?

more options

Solution choisie

You can use the autoconfig.cfg file in the Firefox installation folder to initialize (set/lock) preferences and run privileged JavaScript code. In this case code to open the Library with the Bookmarks Menu folder selected. You can modify the showPlaces variable to open any of the four possible root folders (in this case [1]).

To use Autoconfig, place two files into the Firefox installation directory.

  • on Windows and Linux, they go into the same directory where Firefox is installed
  • on macOS, they go into the Contents/Resources directory of the Firefox.app

The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults\pref" directory where the channel-prefs.js file is located.

The autoconfig.cfg file is placed at the top level of the Firefox directory.

  • autoconfig.cfg and autoconfig.js need to start with a comment line (//)
  • autoconfig.js needs to use Unix line endings (LF instead of CR/LF)

See also:


Content of autoconfig.js

 //
 pref("general.config.filename", "autoconfig.cfg");
 pref("general.config.obscure_value", 0);
 pref("general.config.sandbox_enabled", false); // disable sandbox to allow privileged JavaScript

Content of autoconfig.cfg

// first line in autoconfig.cfg is a comment line
try {
 let {classes:Cc, interfaces:Ci, manager:Cm, utils:Cu} = Components;
 const {Services} = Cu.import('resource://gre/modules/Services.jsm');
 function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
 ConfigJS.prototype = {
  observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
  handleEvent: function (aEvent) {
   let document = aEvent.originalTarget;
   let window = document.defaultView;
   let location = window.location;
   if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
    if (window._gBrowser) {
      let showPlaces = ["AllBookmarks","BookmarksMenu","BookmarksToolbar","UnfiledBookmarks"][1];
      elm = document.getElementById("Browser:ShowAllBookmarks");
      if (elm) {
       elm.setAttribute("oncommand", "PlacesCommandHook.showPlacesOrganizer('"+showPlaces+"')");
      }
    }
   }
  }
 };
 if (!Services.appinfo.inSafeMode) { new ConfigJS(); }
} catch(e) {Cu.reportError(e);}

Modifié le par cor-el

Cela vous a-t-il été utile ?

more options

Thank you, thank you, thank you for a solution that seriously worked well.

For those with the same problem, but don't understand the details on how to create or place the required files, here are the steps:

1. Shut down Firefox if you have it running.

2. Open a plain text compiler such as EditPad Lite 8, available from https://www.editpadlite.com

3. Create a new blank text file

4. Copy and paste the following into the new file (do not add anything else):

//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false); // disable sandbox to allow privileged JavaScript

5.. Save the file as autoconfig.js and put the file in the C:/Program Files/Mozilla Firefox/defaults/pref folder

6. Create a new blank text file

7. Copy and paste the following into the new file (do not add anything else):

// first line in autoconfig.cfg is a comment line try {

let {classes:Cc, interfaces:Ci, manager:Cm, utils:Cu} = Components;
const {Services} = Cu.import('resource://gre/modules/Services.jsm');
function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
ConfigJS.prototype = {
 observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
 handleEvent: function (aEvent) {
  let document = aEvent.originalTarget;
  let window = document.defaultView;
  let location = window.location;
  if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
   if (window._gBrowser) {
     let showPlaces = ["AllBookmarks","BookmarksMenu","BookmarksToolbar","UnfiledBookmarks"][1];
     elm = document.getElementById("Browser:ShowAllBookmarks");
     if (elm) {
      elm.setAttribute("oncommand", "PlacesCommandHook.showPlacesOrganizer('"+showPlaces+"')");
     }
   }
  }
 }
};
if (!Services.appinfo.inSafeMode) { new ConfigJS(); }

} catch(e) {Cu.reportError(e);}

8. Save the file as autoconfig.cfg and put the file in the C:/Program Files/Mozilla Firefox folder

9. Restart Firefox, click Bookmarks / Manage Bookmarks, and it will default to the Bookmarks Menu

Cela vous a-t-il été utile ?

Poser une question

Vous devez vous identifier avec votre compte pour répondre aux messages. Veuillez poser une nouvelle question, si vous n’avez pas encore de compte.