Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Pomoc přepytać

Hladajće so wobšudstwa pomocy. Njenamołwimy was ženje, telefonowe čisło zawołać, SMS pósłać abo wosobinske informacije přeradźić. Prošu zdźělće podhladnu aktiwitu z pomocu nastajenja „Znjewužiwanje zdźělić“.

Dalše informacije

Is there an API that allows extensions to change vertical tab related settings?

  • 3 wotmołwy
  • 0 ma tutón problem
  • 38 napohladow
  • Poslednja wotmołwa wot regunakyle

more options

Hi, I want to make a simple extension for Firefox that auto toggles vertical tab based on the aspect ratio of the Firefox window. I found `sidebar.verticalTabs` in about:config that toggles vertical tabs, but a simple googling tells me that it is not possible for web extension to modify about:config values. Is there any other API that toggle vertical tabs? Thanks!

Hi, I want to make a simple extension for Firefox that auto toggles vertical tab based on the aspect ratio of the Firefox window. I found `sidebar.verticalTabs` in about:config that toggles vertical tabs, but a simple googling tells me that it is not possible for web extension to modify about:config values. Is there any other API that toggle vertical tabs? Thanks!

Wubrane rozrisanje

Turns out there is a browserSettings API for vertical tabs after all, but it is on Firefox 142.0 and later.

Kudos to u/Random3838 on r/firefox. Related bugzillas: https://bugzilla.mozilla.org/show_bug.cgi?id=1946600 https://bugzilla.mozilla.org/show_bug.cgi?id=1762975

Tutu wotmołwu w konteksće čitać 👍 0

Wšě wotmołwy (3)

more options

Well, seems like there is no web extension API that can change vertical tab behavior. Instead I created a hack: autoconfig.js

autoconfig.js ```javascript // This file should be in <Firefox binary dir>/defaults/pref pref("general.config.filename", "auto-toggle-vertical-tabs.js"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false); ```

auto-toggle-vertical-tabs.js ```javascript // DO NOT DELETE THIS LINE // This file should go to <Firefox binary dir> // support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig

"use strict";

function shouldUseVerticalTabs(width, height) {

 return width <= 1080;

}

try {

 let { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu } = Components;
 var Services =
   globalThis.Services ||
   ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
 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;
     window.addEventListener("resize", () => {
       if (shouldUseVerticalTabs(window.innerWidth, window.innerHeight)) {
         pref("sidebar.verticalTabs", true);
       } else {
         pref("sidebar.verticalTabs", false);
       }
     });
   },
 };
 if (!Services.appinfo.inSafeMode) {
   new ConfigJS();
 }

} catch (e) {

 Cu.reportError(e);

} ```

The only problem with this script is that vertical tab is a global setting. If you have two windows, one width <= 1080, another width > 1080, then there will be an infinite loop and you will have to forcefully kill one of the window.

There is already a feature request of making vertical tab a per-window setting. You can upvote it here: https://connect.mozilla.org/t5/ideas/vertical-tabs-per-window/idi-p/94064

Wot regunakyle změnjeny

Wužitny?

more options

Hi

I recommend that you ask about this in the dedicated Add-ons development forum at:

https://discourse.mozilla.org/c/add-ons/35

Wužitny?

more options

Wubrane rozrisanje

Turns out there is a browserSettings API for vertical tabs after all, but it is on Firefox 142.0 and later.

Kudos to u/Random3838 on r/firefox. Related bugzillas: https://bugzilla.mozilla.org/show_bug.cgi?id=1946600 https://bugzilla.mozilla.org/show_bug.cgi?id=1762975

Wužitny?

Stajće prašenje

Dyrbiće so pola swojeho konta přizjewić, zo byšće na přinoški wotmołwił. Prošu stajće nowe prašenje, jeli hišće wužiwarske konto nimaće.