How do I lock down the navigation bar so that when the user opens Firefox they can not change anything in the navigation bar.
How do hide the navigation bar so that the the user only has access to the tabs. I used to be able to do it using the userChrome.css file in earlier versions but this does not seem to work with the newer versions of Firefox.
所有回复 (9)
You might have to find a newer version or userchrome.css that has that enabled again if FF doesn't have one or doesn't have the option. So what are you doing that requires this block? If this is for security reason you should ask a security company that has that solution.
ano.m said
How do hide the navigation bar so that the the user only has access to the tabs. I used to be able to do it using the userChrome.css file in earlier versions but this does not seem to work with the newer versions of Firefox.
Is that regarding Quantum? Firefox 57-plus Maybe if you post the userChrome code you were using someone here someone may be able to see why it quit working.
Most userChrome.css that I have seen posted for Quantum doesn't need the @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); line, but I am still using that @namespace line for part of my userChrome.css file in Quantum which I have near the end of the file. IOW, the file starts with the Quantum code and when that code is complete I have the @namespace line and then bits and pieces of older code that I have been using for years.
Just a suggestion to fiddle with.
I am using Quantum v58. What I am trying to do is lock down the page as the user does not need access to the navigation bar. More like the page you get when in rkiosk mode. I do not want the user to be able to toggle between different screens for security reasons.
I modified this in v31 by putting the userChrome.css file in the main Mozilla folder (Mozilla Firefox\defaults\profile\chrome) and any user that launched the firefox.exe from this folder would have the chrome folder copied down to their own profile (C:\Users\xxxxx\AppData\Roaming\Mozilla\Firefox\Profiles\xxx.default). My problem is that the folder is not being copied automatically as before. But if I copy it manually, the lock down effect I am looking for works. So I assume my userChrome.css file is working.
Yes, it does sound like the userChrome.css file is correctly formatted.
Then the issue is likely the formatting of prefs in the .cfg file used to "tell" Firefox to use that userChrome.css file. Sorry, can't help you with that as it is beyond my knowledge.
See whether the userChrome.css section works for you:
cor-el said
See whether the userChrome.css section works for you:
Thanks for this link. It has a lot of information on the userChrome.css file that I want to use. But it looks like the method he is suggesting for the profile stopped working with version 46. The profile folder is no longer getting created in the browser\defaults path as before.
I am still looking at this in case I missed something in his posts.
This code in mozilla.cfg creates the chrome folder and userChrome.css.
// var {classes:Cc, interfaces:Ci, utils:Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile); profileDir.append("chrome"); if( !profileDir.exists() || !profileDir.isDirectory() ) { profileDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777); } profileDir.append("userChrome.css"); var fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); fos.init(profileDir, -1, -1, false); var css = "#context-setDesktopBackground { display: none;}"; fos.write(css, css.length); fos.close();
So to just to clarify, the above text needs to be in the mozilla.cfg file and the actual userChrome needs to be in the "\Mozilla Firefox\defaults\profile\chrome" folder for it to e copied down every time?
Yes about this code being in mozilla.cfg. You need to place the content of userChrome.css as well in mozilla.cfg with this code. This line specifies what to put in userChrome.css:
- var css = "#context-setDesktopBackground { display: none;}";
Otherwise you would have to modify the code to copy a file to the profile folder or read the css variable from a file..