xiaoxiaoflood / firefox-scripts

userChromeJS / autoconfig.js and extensions
Mozilla Public License 2.0
954 stars 83 forks source link

Mac install? #103

Closed CouldBeThis closed 2 years ago

CouldBeThis commented 2 years ago

I am trying to work out Mac install. I believe I followed rest of instructions but not able to suss out what is required here. And Mac users or knowers can clarify?

In the readme:

→ For Linux and macOS paths, read this and this.

Second link to https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Enterprise_deployment_before_60#Configuration is now broken

Here is the most recent archive.org copy of that URL, from Feb 2021.

But perhaps it is no longer accurate? Title states it is regarding v <60.

Page is talking about a .cfg file which is not already in the repo. Am I supposed to create it? The instructions here as to what it is to contain are confusing to me.

Tried making sense of where to put the existing files.

For all the below, /Applications/Firefox.app/Contents/ is the root directory

1. Keep files in structure suggested by how they were packaged:

This led to starting as normal with nothing seeming to be different.

2. Put all files together

Starting as normal with no changes but had error:

Configuration error.

Failed to read the configuration file. Please contact your system administrator.

3. mimic windows file locations

In #8 linked above, it states windows users put alongside the exe. In Mac, the full path to the actual executable is: MacOS/firefox

The other files in same directory are some other small applciation files like Crash Reporter and .dylib files.

Starting as normal with no changes but had same error:

Configuration error.

Failed to read the configuration file. Please contact your system administrator.

Didn't try: mimic linux

There is also a directory, /Applications/Firefox.app/Contents/Resources/browser but unlike what's reported in Linux, its only subdirectory is features containing a half dozen xpis from mozilla such as screenshots

At this point I feel like I would be throwing spaghetti at the wall to keep trying. 🍝 Hope I provided the correct information and not too much.

xiaoxiaoflood commented 2 years ago

Second link [...] is now broken

Thanks, I'll fix that.

Page is talking about a .cfg file which is not already in the repo.

.cfg file is the same as config.js in fx-folder.zip. mozilla.cfg, config.js, autoconfig.js... there are many names for the same thing, because the file can have any name. The name should match the value of general.config.filename. https://github.com/xiaoxiaoflood/firefox-scripts/blob/d609a1d03d9a78e01668b4b5528cfbc9a001788a/installation-folder/config-prefs.js#L2

config-prefs.js (pre existing)

Sure? Here the pre existing file in defaults/pref is channel-prefs.js, not config-prefs.js. You shouldn't need to overwrite anything.


Not sure if this will work because I have no experience with macOS, but you can try:

  1. Open about-config and set devtools.chrome.enabled = true to enable input in Browser Console.
  2. Open Browser Console (Ctrl+Shift+J on Windows, or hamburger menu → More Tools → Browser Console or menubar → Tools → Browser Tools → Browser Console).
  3. Paste and press Enter: Services.dirsvc.get('PrfDef', Ci.nsIFile).path The output should be where you must paste config-prefs.js.
  4. For the folder where to paste config.js, you can try one of the following: Services.dirsvc.get('GreD', Ci.nsIFile).path Services.dirsvc.get('GreBinD', Ci.nsIFile).path Services.dirsvc.get('CurWorkD', Ci.nsIFile).path For me, all of these return the folder where my config.js is placed, next to firefox.exe.
xiaoxiaoflood commented 2 years ago

Mac path for fx-folder.zip files:

Firefox.app\Contents\Resources

So