Skip to content

Latest commit

 

History

History
35 lines (32 loc) · 1.82 KB

sort-firefox-extensions-list.md

File metadata and controls

35 lines (32 loc) · 1.82 KB
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
sort-firefox-extensions-list
firefox
public
2023-06-16 09:49:30 -0700
2024-09-23 09:52:18 -0700
false
20230616164930
false
false
firefox
extensions
javascript
addon
Sort Firefox Extensions List
tech-note

Follow the below steps to sort your extension list (jigsaw icon) in Firefox until they have a way to sort it automatically (thanks to this script).

  1. Open about:addons
  2. Open the web console
  3. Copy and paste the below code into the console and run it.
javascript:AddonManager.getAddonsByTypes(["extension"]).then(addons=>{var order=[];addons.sort((a,b)=>{return a.name.localeCompare(b.name);}).forEach(addon=>{if(!(addon.isBuiltin||addon.isSystem)){order.push(`"${addon.id.toLowerCase().replace(/[{}@.]/g,"_")}-browser-action"`);}});var oVal=Services.prefs.getStringPref("browser.uiCustomization.state");var nVal=oVal.replace(/(^.*,"unified-extensions-area":\[)[^\]]*(\],.*$)/,"$1"+order.join(",")+"$2");Services.prefs.setStringPref("browser.uiCustomization.state",nVal);console.log(`// old\n// Services.prefs.setStringPref("browser.uiCustomization.state", "${oVal.replace(/(["\\])/g,'\\$1')}");\n\n// new\nServices.prefs.setStringPref("browser.uiCustomization.state", "${nVal.replace(/(["\\])/g,'\\$1')}");\n`);console.log(`// about:config pref "browser.uiCustomization.state" changed, old/new values are shown above, ** please restart Firefox to apply **`);});