Tried the modifications, but got an error message (below). Is it related to config-prefs.js, a minimal bootstrap stripped from userChromeJS?
I'm currently using a macro that uses 3 default shortcuts (Alt+V -> T -> B) in Firefox ESR 78 to hide/show the Bookmarks Toolbar, but it shows the activated menus and looks ugly. With one shortcut to do the same the menus won't show up and is a faster/efficient way to do it.
I'm familiar with dorando keyconfig when it worked with previous versions of Firefox, but not with UI scripting in config files (.js).
The original post where I got these two files:
https://www.reddit.com/r/firefox/commen ... _configjs/
Configuration Error
Failed to read the configuration file. Please contact your system administrator.
Code: Select all
// **config.js** - a minimal bootstrap to restore Ctrl+Shift+B for Library (switched with toggleBookmarksToolbar at Ctrl+Shift+O) - by AveYo
// create in Firefox install directory - for windows = **C:\Program Files\Mozilla Firefox\**
// must also create C:\Program Files\Mozilla Firefox\defaults\pref\config-prefs.js
try {
let { classes: Cc, interfaces: Ci, manager: Cm } = Components;
const {Services} = Components.utils.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 mozilla = window.document.getElementById('manBookmarkKb');
mozilla.setAttribute( "oncommand", "BookmarkingUI.toggleBookmarksToolbar('bookmark-tools');" );
mozilla.removeAttribute("command");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
}
};
if (!Services.appinfo.inSafeMode) { new ConfigJS(); }
} catch(ex) {};
Code: Select all
// **config-prefs.js** - a minimal bootstrap to restore Ctrl+Shift+B for Library (switched with toggleBookmarksToolbar at Ctrl+Shift+O) - by AveYo
// create in Firefox defaults pref directory - for windows = **C:\Program Files\Mozilla Firefox\defaults\pref\**
// must also create C:\Program Files\Mozilla Firefox\config.js
pref("general.config.filename", "config.js");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);