X
Tap here to go to the mobile version of the site.

Support Forum

Hiding toolbar from the Firefox pdf Reader

Posted

This question has been asked by many developers but I found this : https://support.mozilla.org/en-US/questions/1119523 answer that has worked for #loriR. The question is where do I add css to disabled the toolbar?

This question has been asked by many developers but I found this : https://support.mozilla.org/en-US/questions/1119523 answer that has worked for #loriR. The question is where do I add css to disabled the toolbar?
Quote

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17524 solutions 158458 answers

Note that you won't be able to use feature available on the toolbar.

Add code to the userContent.css file.


#outerContainer #mainContainer div.toolbar {
  display: none !important; /* hide PDF viewer toolbar */
}

#outerContainer #mainContainer #viewerContainer {
  top: 0 !important; /* move doc up into empty bar space */
}

You need to create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist.

  • use a plain text editor (Windows: Notepad; Mac: Textedit) to create a (new) userContent.css file in the chrome folder (file name is case sensitive)
  • paste the code in the userContent.css file in the editor window
  • make sure the userChrome.css file starts with the default @namespace line

If you are on Windows:

  • make sure you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userContent.css

Otherwise Windows may add a hidden .txt file extension and you end up with a not working userContent.css.css.txt file.

  • make sure you do not have a double .css.css file extension (userContent.css.css.css) if it is still not working

See also:

Note that in this case you need userContent.css

In Firefox 69 and later you need to set this pref to true on the about:config page to enable userChrome.css and userContent.css in the chrome folder.

You can open the about:config page via the location/address bar. You can accept the warning and click "I accept the risk!" to continue.

Note that you won't be able to use feature available on the toolbar. Add code to the <b>userContent.css</b> file. <hr> <pre><nowiki> #outerContainer #mainContainer div.toolbar { display: none !important; /* hide PDF viewer toolbar */ } #outerContainer #mainContainer #viewerContainer { top: 0 !important; /* move doc up into empty bar space */ } </nowiki></pre> ---- You need to create the <b>chrome</b> folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist. *use a plain text editor (Windows: Notepad; Mac: Textedit) to create a (new) <b>userContent.css</b> file in the <i>chrome</i> folder (file name is case sensitive) *paste the code in the userContent.css file in the editor window *make sure the userChrome.css file starts with the default <u>@namespace line</u> If you are on Windows: *make sure you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userContent.css Otherwise Windows may add a hidden <i>.txt</i> file extension and you end up with a not working <i>userContent.css.css.txt</i> file. *make sure you do not have a double <i>.css.css</i> file extension (userContent.css.css.css) if it is still not working See also: *https://www.userchrome.org/what-is-userchrome-css.html *https://www.userchrome.org/how-create-userchrome-css.html Note that in this case you need userContent.css In Firefox 69 and later you need to set this pref to true on the <b>about:config</b> page to enable userChrome.css and userContent.css in the chrome folder. *toolkit.legacyUserProfileCustomizations.stylesheets = true *https://www.userchrome.org/firefox-changes-userchrome-css.html You can open the <b>about:config</b> page via the location/address bar. You can accept the warning and click "I accept the risk!" to continue. *https://support.mozilla.org/en-US/kb/about-config-editor-firefox
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.