Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

macOS disable Firefox default browser prompt non-interactively

  • 2 답장
  • 1 이 문제를 만남
  • 1 보기
  • 최종 답변자: hal.martin

more options

I am trying to configure Firefox on macOS to not prompt the user to make it the default browser.

I am using the following script to create the profile and set the user preferences after installing Firefox by copying `Firefox.app` from the downloaded DMG: ```

  1. !/bin/sh

open -a Firefox.app --args -CreateProfile default sleep 1

write_userpref() { USER=$(whoami) PROFILE=$(ls -1 "/Users/${USER}/Library/Application Support/Firefox/Profiles/" | grep -E "\.default$") cat << EOF > "/Users/${USER}/Library/Application Support/Firefox/Profiles/${PROFILE}/user.js" // mandatory comment? user_pref("app.update.auto", false); user_pref("app.update.disable_button.showUpdateHistory", false); user_pref("app.update.enabled", false); user_pref("breakpad.reportURL", ""); user_pref("browser.newtabpage.activity-stream.feeds.topsites", false); user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); user_pref("browser.tabs.crashReporting.sendReport", false); user_pref("browser.discovery.enabled", false); user_pref("browser.defaultbrowser.notificationbar", false); user_pref("browser.shell.checkDefaultBrowser", false); user_pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", false); user_pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true); user_pref("browser.newtabpage.enabled", false); user_pref("experiments.enabled", false); user_pref("extensions.pocket.enabled", false); user_pref("toolkit.telemetry.enabled", false); user_pref("update_notifications.enabled", false); EOF }

write_userpref

open -a Firefox.app --args -new-tab -P default "about:blank" sleep 3 osascript -e 'quit app "Firefox"' sleep 2

open -a Firefox.app --args -P default about:blank ```

Here's the behaviour I'm seeing:

  1. Firefox starts to an `about:blank` tab, however there is a second "Firefox Privacy Notice" tab
  2. AppleScript quits Firefox
  3. Firefox starts to an `about:blank` tab, however it is now prompting me to make it the default browser

I do not want Firefox to prompt the user to become the default browser.

My ideal scenario is that Firefox starts without the "Firefox Privacy Notice" tab and without prompting me to make it the default browser. From the observed behaviour, this doesn't seem possible.

Can anyone tell me how I can accomplish this without user interaction or MDM?

I am trying to configure Firefox on macOS to not prompt the user to make it the default browser. I am using the following script to create the profile and set the user preferences after installing Firefox by copying `Firefox.app` from the downloaded DMG: ``` #!/bin/sh open -a Firefox.app --args -CreateProfile default sleep 1 write_userpref() { USER=$(whoami) PROFILE=$(ls -1 "/Users/${USER}/Library/Application Support/Firefox/Profiles/" | grep -E "\.default$") cat << EOF > "/Users/${USER}/Library/Application Support/Firefox/Profiles/${PROFILE}/user.js" // mandatory comment? user_pref("app.update.auto", false); user_pref("app.update.disable_button.showUpdateHistory", false); user_pref("app.update.enabled", false); user_pref("breakpad.reportURL", ""); user_pref("browser.newtabpage.activity-stream.feeds.topsites", false); user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); user_pref("browser.tabs.crashReporting.sendReport", false); user_pref("browser.discovery.enabled", false); user_pref("browser.defaultbrowser.notificationbar", false); user_pref("browser.shell.checkDefaultBrowser", false); user_pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", false); user_pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true); user_pref("browser.newtabpage.enabled", false); user_pref("experiments.enabled", false); user_pref("extensions.pocket.enabled", false); user_pref("toolkit.telemetry.enabled", false); user_pref("update_notifications.enabled", false); EOF } write_userpref open -a Firefox.app --args -new-tab -P default "about:blank" sleep 3 osascript -e 'quit app "Firefox"' sleep 2 open -a Firefox.app --args -P default about:blank ``` Here's the behaviour I'm seeing: # Firefox starts to an `about:blank` tab, however there is a second "Firefox Privacy Notice" tab # AppleScript quits Firefox # Firefox starts to an `about:blank` tab, however it is now prompting me to make it the default browser I do not want Firefox to prompt the user to become the default browser. My ideal scenario is that Firefox starts without the "Firefox Privacy Notice" tab and without prompting me to make it the default browser. From the observed behaviour, this doesn't seem possible. Can anyone tell me how I can accomplish this '''without user interaction or MDM'''?
첨부된 스크린샷

선택된 해결법

Back to answer my own question.

The root cause of the above script not working is that it was being executed as the deployment user and not the UI user.

Quick solution is to just dump the script contents into a file in /private/tmp/ and then sudo -u $UI_USERNAME sh /private/tmp/script.sh

문맥에 따라 이 답변을 읽어주세요 👍 0

모든 댓글 (2)

more options

Since I cannot add multiple images to the same post, here is a screenshot of the behaviour after initially setting the user preferences. Firefox is not prompting the user to make it the default, however there is a background tab "Firefox Privacy Notice" that I have found no way to suppress in user_pref.

도움이 되셨습니까?

more options

선택된 해결법

Back to answer my own question.

The root cause of the above script not working is that it was being executed as the deployment user and not the UI user.

Quick solution is to just dump the script contents into a file in /private/tmp/ and then sudo -u $UI_USERNAME sh /private/tmp/script.sh

도움이 되셨습니까?

질문하기

글에 답글을 달기 위해서는 계정으로 로그인해야만 합니다. 계정이 아직 없다면 새로운 질문을 올려주세요.