Izimpendulo zakamuva ze-Is there a way to quickly hide all extensions?https://support.mozilla.org/zu/questions/13271732021-03-31T06:15:33-07:00I tweaked the code a bit to make it look better for me and corrected the className attribute.
This c2021-03-31T06:15:33-07:00cor-elhttps://support.mozilla.org/zu/questions/1327173#answer-1402489<p>I tweaked the code a bit to make it look better for me and corrected the className attribute.
This code works like a toggle.
</p>
<pre>(function(){ /*toggle toolbar extension buttons*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
var exts = nt.querySelectorAll('.chromeclass-toolbar-additional[class*=webextension]');
var oldX = nt.querySelector('#webextension-toggle-button');
if (oldX) {oldX.parentNode.removeChild(oldX); return}
if (exts.length) {
var newEl = document.createElement("toolbarbutton");
newEl.className = 'toolbarbutton-1 chromeclass-toolbar-additional';
<a href="http://newEl.id" rel="nofollow">newEl.id</a> = 'webextension-toggle-button';
newEl.style.display = 'inline-block';
newEl.style.cursor = 'pointer';
newEl.style.margin = '4px 4px';
newEl.style.height = '15px';
newEl.style.background = '#ddd';
newEl.innerHTML = 'X';
var toggleEl = exts[0].parentNode.insertBefore(newEl, exts[0]);
toggleEl.onclick = function(ev){
ev.preventDefault();
nt.querySelectorAll('.chromeclass-toolbar-additional[class*=webextension]').forEach(function(el){el.style.display=(el.style.display=='none'?'block':'none');});
return false;
}
}
})()</pre>firefox.dh said
You should be able to add this into your userChrome.js file as @jscher2000 was expla2021-03-31T04:58:15-07:00jscher2000https://support.mozilla.org/zu/questions/1327173#answer-1402478<em><p>firefox.dh <a href="#answer-1402473" rel="nofollow">said</a></p></em>
<blockquote>You should be able to add this into your userChrome.js file as @jscher2000 was explaining for the styles. I didn't get that far.
</blockquote>
<p>Injecting scripts is a little more complex and risky than just applying styles, so I don't usually recommend it myself.
</p>
<ul><li> My old article: <a href="https://www.userchrome.org/what-is-userchrome-js.html" rel="nofollow">https://www.userchrome.org/what-is-userchrome-js.html</a>
</li><li> Find help on this subreddit: <a href="https://www.reddit.com/r/FirefoxCSS/" rel="nofollow">https://www.reddit.com/r/FirefoxCSS/</a>
</li></ul>@filip
I cannot but respond with quoting my original question.
"Pinning to overflow menu is not a2021-03-31T04:34:37-07:00firefox.dhhttps://support.mozilla.org/zu/questions/1327173#answer-1402473<p>@filip
</p>
<blockquote>
I cannot but respond with quoting my original question.
"Pinning to overflow menu is not a solution. It takes many clicks and a long time."
</blockquote>
<p>yeah - boobed that
</p><p>Not sure if you derived something from the responses, but I combined the feedback from @cor-el and @jscher2000 into an option that may work.
</p><p>The following code places an "X" button before the extension icons. You can dbl-click it to toggle visibility of any extension icons that follow.
</p><p>I spent a few min trying to get a pretty icon in there, but repeating the same code as other icons doesn't work. Something fancy is happening during rendering. I also didn't intend for this to be a dbl-click, but something on the toolbar captures the first click.
</p><pre> (function(){ /*toggle toolbar extension buttons*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
var exts = nt.querySelectorAll('.chromeclass-toolbar-additional[class*=webextension]');
if (exts.length) {
var newEl = document.createElement("toolbarbutton");
newEl.class = 'toolbarbutton-1 chromeclass-toolbar-additional webextension-toggle-button';
newEl.style.display = 'inline-block';
newEl.style.lineHeight = '40px';
newEl.style.padding = '0 10px';
newEl.style.cursor = 'pointer';
newEl.innerHTML = 'X';
var toggleEl = exts[0].parentNode.insertBefore(newEl, exts[0]);
toggleEl.onclick = function(ev){
ev.preventDefault();
nt.querySelectorAll('.chromeclass-toolbar-additional[class*=webextension]').forEach(function(el){el.style.display=(el.style.display=='none'?'block':'none');});
return false;
}
}
})()
</pre>
<p><br>
To implement this you need to set "devtools.chrome.enabled" to "true" on your "about:config" page. Then press "Shift+Ctrl+J" to open your Browser Console, paste and run the code [ENTER].
</p><p>You should be able to add this into your userChrome.js file as @jscher2000 was explaining for the styles. I didn't get that far.
</p><p>You mentioned browser experience - if you want to get the navbar HTML to review you can use this to dump it to console
</p><pre> (function(){ /*toggle toolbar extension buttons*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
console.log(nt.innerHTML);
})()
</pre>Firefox can be set to look for an optional user style sheet at startup. It is rather particular abou2021-02-26T00:32:14-08:00jscher2000https://support.mozilla.org/zu/questions/1327173#answer-1394921<p>Firefox can be set to look for an optional user style sheet at startup. It is rather particular about the location and naming, so take your time in setting this up to minimize re-do's. I suggest 10 quiet minutes to work through it.
</p><p>(For anyone who already has a userChrome.css file set up, you just need to add the rule under (A) to your file.)
</p><p><strong>(A) Select and copy the following style rule code</strong>
</p>
<pre>/* Hide extension buttons to the right of the Options button */
#preferences-button ~ .webextension-browser-action {
display: none&nbsp;!important;
}
</pre>
<p><strong>(B) Generate and download a</strong> userChrome.css <strong>file</strong>
</p><p>Open the following page and paste the above rules into the editor, replacing the sample rule:
</p><p><a href="https://www.userchrome.org/download-userchrome-css.html" rel="nofollow">https://www.userchrome.org/download-userchrome-css.html</a>
</p><p>Then click "Generate CSS File" and save the userChrome.css file to your computer. (See first attached screenshot)
</p><p>Use the downloads list on the toolbar to open the downloads folder directly to the new userChrome.css file. (See second attached screenshot)
</p><p>Minimize that file browser window for later reference.
</p><p><strong>(C) Create a new</strong> chrome <strong>folder in your profile folder</strong>
</p><p>The following article has the detailed steps for that (#1, #2, and I recommend #3)
</p><p><a href="https://www.userchrome.org/how-create-userchrome-css.html" rel="nofollow">https://www.userchrome.org/how-create-userchrome-css.html</a>
</p><p><em>I have videos for both Mac and Windows in case the text is not clear.</em>
</p><p><strong>(D) Move the</strong> userChrome.css <strong>file you downloaded in Step B into the</strong> chrome <strong>folder you created in Step C</strong>
</p><p><strong>(E) Set Firefox to look for userChrome.css at startup</strong> -- see step #6 in the above article.
</p><p>The next time you exit Firefox and start it up again, it should discover that file and apply the rule.
</p><p>Success?
</p><p>Once you start tweaking the interface this way, you'll probably find more and more things you want to do. I suggest bookmarking the pages where you get the code for future reference because changes to Firefox may break them and it's easier to request an update if you can find the source.
</p>Individual extension buttons have an additional value class in their class attribute, "webextension-2021-02-26T00:23:22-08:00jscher2000https://support.mozilla.org/zu/questions/1327173#answer-1394920<p>Individual extension buttons have an additional value class in their class attribute, "webextension-browser-action". However, I don't know whether a Browser Console script can find and hide them individually.
</p><p>You could set up a style rule that will hide the buttons based on another factor. For example, I don't usually display the Options button on my toolbar (it's one of the many available buttons in the Customize panel). I created a custom style rule that hides all the extension buttons to the right of the Options button so I can trigger that if I move the Options button onto the bar. The following screenshot shows the bar with different rules with and without the Options button (the <a href="https://developer.mozilla.org/docs/Tools/Browser_Console" rel="nofollow">Browser Toolbox</a> window is in front of the main window):
</p><p><img src="https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2021-02-26-08-20-08-6ae1cc.png">
</p>
<hr>
<p>I'll describe how to set that up in the next reply. If you want to use a different button as your trigger, we can look up its ID.
</p>@cor-el that's pretty epic. I love the browser console code toggle. This seems very powerful.
Do yo2021-02-25T21:20:08-08:00filipfoxhttps://support.mozilla.org/zu/questions/1327173#answer-1394870<p>@cor-el that's pretty epic. I love the browser console code toggle. This seems very powerful.
</p><p>Do you have an idea of how to target just the extensions area?
I don't see how to figure this out; I don't have the browser development experience and Inspect Elements does not work on browser itself.
</p><p>If I collapse everything like in your script, then I don't see any advantage over a fullscreen mode.
</p>I personally use code in the Browser Console (not the Web Console) to hide the toolbar area if neces2021-02-25T04:02:28-08:00cor-elhttps://support.mozilla.org/zu/questions/1327173#answer-1394663<p>I personally use code in the Browser Console (not the Web Console) to hide the toolbar area if necessary.
The code works as a toggle and you can possibly recall the code via the multi-line editor.
Note that you need to enable the command line.
</p>
<ul><li>"3-bar" menu button or Tools -&gt; Web Developer
</li><li><a href="https://developer.mozilla.org/en-US/docs/Tools/Browser_Console" rel="nofollow">https://developer.mozilla.org/en-US/docs/Tools/Browser_Console</a>
</li></ul>
<hr>
<pre>(function(){ /*toggle navigator-toolbox*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
var isCollapsed = nt.getAttribute("collapsed") == "true";
if (isCollapsed){nt.removeAttribute("collapsed");}
else {nt.setAttribute("collapsed", "true");}
})()</pre>Fullscreen is a good idea, but in my case it does not work as I am trying to record the browser itse2021-02-25T03:47:59-08:00filipfoxhttps://support.mozilla.org/zu/questions/1327173#answer-1394660<p>Fullscreen is a good idea, but in my case it does not work as I am trying to record the browser itself... and I'm recording a screencast, not taking screenshots.
</p><p>jscher2000, cold idea about the separate profile! I like it, creative thinking.
</p><p>It's quite confusing to be running two firefoxes though and the switching is not very seamless; if I'm switching to a completely new setup each time and re-opening my tabs, I might just as well switch a browser I feel. I did try the separate profile, and it's nice to know about this feature.
</p><p>I guess there is no simple solution; other than switching a browser.
Maybe this could become an addon one day.
</p><p>Thank you for suggestions!
</p>I have a clean profile for demos and screenshots. That's most useful if you don't need all your accu2021-02-25T01:32:52-08:00jscher2000https://support.mozilla.org/zu/questions/1327173#answer-1394617<p>I have a clean profile for demos and screenshots. That's most useful if you don't need all your accumulated "stuff" like bookmarks, layout modifications, or extensions. If you want to give it a try:
</p><p><strong>Add Alternate Profile</strong>
</p><p>Inside Firefox, type or paste <strong>about:profiles</strong> in the address bar and press Enter/Return to load it.
</p><p>Take a quick glance at the page and make a mental note of which Profile has this notation: <strong>This is the profile in use and it cannot be deleted.</strong> That is your current default profile.
</p><p>Click the "Create a New Profile" button, then click Next. Assign a name like Demo, ignore the option to relocate the profile folder, and click the Finish button.
</p><p>Firefox will switch your default profile to the new one, so click the <strong>Set as Default Profile</strong> button for your regular one to avoid an unwanted surprise at your next startup.
</p><p>Scroll down to Demo and click its <strong>Launch profile in new browser</strong> button.
</p><p>Firefox should open a new window that looks like a brand new, uncustomized installation. (Your existing Firefox window(s) should not be affected.) Please ignore any tabs enticing you to connect to a Sync account or to activate extensions found on your system to avoid cross-over with your main profile.
</p><p>You might want to change the theme so that you can easily spot which is your Demo profile when switching windows. More info on themes: <a href="/en-US/kb/use-themes-change-look-of-firefox" rel="nofollow">Use themes to change the look of Firefox</a>.
</p><p><em>Then use as needed...</em>
</p><p>When you are done with the recording, you can close the extra window without affecting your regular Firefox profile. Demo will remain available on the about:profiles page.
</p>Can you hide those icons in Full Screen Mode ?
I'm not sure how this works on Mac ?
I norm2021-02-25T00:48:14-08:00cor-elhttps://support.mozilla.org/zu/questions/1327173#answer-1394606<p>Can you hide those icons in Full Screen Mode&nbsp;?
I'm not sure how this works on Mac&nbsp;?
</p><p>I normally do not take a screenshot that includes the user interface, but use the choice to select what to include and I assume that you can do this on Mac as well.
</p>Hi @firefox.dh
I appreciate the answer.
I cannot but respond with quoting my original question.
"P2021-02-25T00:14:56-08:00filipfoxhttps://support.mozilla.org/zu/questions/1327173#answer-1394602<p>Hi @firefox.dh
</p><p>I appreciate the answer.
</p><p>I cannot but respond with quoting my original question.
</p><p>"Pinning to overflow menu is not a solution. It takes many clicks and a long time."
</p><p>---
</p><p>Joking aside, the quest is to find a fast and easy way to do this often.
One click, ideally.
</p>filip,
Have you tried the "Pin to Overflow Menu" option? That will hide the icons behind the overfl2021-02-24T22:19:17-08:00firefox.dhhttps://support.mozilla.org/zu/questions/1327173#answer-1394585<p>filip,
</p><p>Have you tried the "Pin to Overflow Menu" option? That will hide the icons behind the overflow arrow. You would need to unpin them later if you wanted them always visible.
</p><p>To try this, right click and "Pin to Overflow Menu" each icon you wish to hide.
</p>