Используйте менеджер профилей Firefox без изменения профиля по умолчанию

1075
BrenBarn

Я использую разные профили Firefox для разных вещей. (Это Firefox 16.0.2) У меня есть один профиль общего назначения, который я использую для обычного просмотра веб-страниц, а также некоторые другие для других целей (например, взлом javascript). Я хочу иметь два ярлыка: один, который открывает профиль общего назначения, и другой, который открывает диспетчер профилей, чтобы я мог выбирать среди других профилей. Однако я хочу, чтобы профиль общего назначения был установлен по умолчанию, поэтому, если какая-то другая программа пытается открыть ссылку, и у меня нет открытых окон Firefox, она всегда открывает общий профиль.

Я не могу понять, как это сделать. Кажется, что если вы откроете менеджер профилей, вы не сможете избежать изменения текущей настройки «профиля по умолчанию».

Например, предположим, что у меня есть два профиля: «общий» и «другой». Просматривая файл profiles.ini, я вижу, что в качестве профиля по умолчанию установлено «общее». Все хорошо. Я использую ярлык менеджера профилей и открываю менеджер профилей. Я хочу выбрать «другой» профиль. Но есть флажок «Не спрашивать при запуске», и это мешает моему стилю. Если я проверю это, он откроет «другое» и установит его как профиль по умолчанию. Если я не проверяю его, он удаляет настройки по умолчанию в «общем» профиле и оставляет меня без настроек по умолчанию, поэтому, если программа пытается открыть ссылку, она перенесет меня в менеджер профилей. Ни то, ни другое я не хочу. Я хочу открыть «другой» профиль , оставив «по умолчанию» по умолчанию .

По сути, флажок «не спрашивать при запуске», по-видимому, устанавливает один из двух вариантов: открыть профиль и установить его по умолчанию или открыть профиль и сделать так, чтобы профиль по умолчанию отсутствовал. Но я хочу третий вариант: открыть профиль, оставив для профиля по умолчанию то, что уже установлено. Есть ли способ сделать это?

Изменить: Основываясь на некоторых ответах, я хочу уточнить, что я не хочу один ярлык для профиля . Независимо от того, сколько профилей у меня есть, мне нужно ровно два ярлыка: один, который всегда открывает профиль по умолчанию, и другой, который позволяет мне интерактивно выбирать из всех профилей, но не меняет, какой профиль помечен как стандартный.

4

6 ответов на вопрос

1
Scott R

You can do this by installing Firefox portable (http://portableapps.com), and install it to hard drive in a NEW location rather than a USB drive. Here is how I would do it (although you can tweak this to achieve want you want), leave your standard installation where it is. Clone the portable folder to second location. Copy your first profile data to portable folder "DATA" sub-folder as described on their website and copy your second profile to the the second new portable "DATA" sub-folder (the folder below the one containing FirefoxPortable.EXE). Start each FirefoxPortable.EXE and check it is customized correctly (eg. addons, plugins in the normal way etc). Optionally rename FirefoxPortable.EXE to FFP.EXE if you like short names :-) and setup two shortcuts to each of these portable installation folder's FFP.EXE. I have used V6.0 and V25.0.1 this way and worked fine.

Advantages

  • You an run completely separate configs (they can even be different versions of Firefox if you desire). Yes it takes up more disk space as you clone firefox application but I find this easier to manage.
  • I run about 30 addons and have had no issue with the portable version
  • If you have a collection of active and inactive addons troubleshooting addon confilcts is easier. Just take a clone of the folder and use it for testing just a single addon switched on without messing up you main profile.

Issues (applies if Firefox is default browser)

  • Leave you standard installation as is and set as default browser
  • Leave your old standard installation with the profile manager prompt as the default. (In your case you could run this as your "general" profile with no prompting". Occasionally some application will try to launch this default browser when you are not expecting it (e.g. eg a chat client that opens URLs) and whenever you see the profile prompt just exit and start the correct portable version via shortcut
  • Well now there are 3 versions for Firefox - which should it use for files? The solution is always start the Firefox from the shortcuts before opening *.url, *.htm[l], or *.mht and they will open in the active Firefox correctly.
  • If you use firefox sync I would expect that you name each profile as a different "device name" for it to play nicely. For example syncing your bookmarks across all profiles.
  • I do software updates manually I would recommend that.
Это все еще более обременительно, чем мне бы хотелось, потому что для этого нужно, чтобы я установил несколько Firefox, а затем выделил для них отдельные значки. Как я уже говорил в посте, мне бы хотелось, чтобы ** имел только две ** иконки: одна для «открыть профиль по умолчанию» и одна для «позвольте мне выбрать, какой профиль открыть * только на этот раз * без изменение профиля по умолчанию ". BrenBarn 9 лет назад 0
0
JC2k8

The only way to achieve your goal would be to write-protect your profiles.ini file after the initial setup. This way Firefox wouldn't be able to update the file leaving everything as you set it up.

  1. Set up your profiles.
  2. Select your default profile by selecting a profile in the profile manager and checking "Don't ask at startup".
  3. Mark your profiles.ini as read only.

From now on, starting Firefox without -p or -p "profile name" or -p "profile path" will always start your default profile. Opening a profile via the profile manager or the -p switch can't change your profiles.ini.

Obviously, you'd have to make your file writeable again to change things or create new profiles. Other than that you should be fine.

0
Jérôme

Я не знаю, какая у вас операционная система, но если вы используете Unix, у меня может быть скрипт, который будет делать то, что вам нужно (именно то поведение, которое мне тоже нужно, если я вас правильно понял).

Идея состоит в том, чтобы использовать скрипт для запуска вашего «другого» firefox. Сценарий определяет профиль по умолчанию, просматривая profiles.iniфайл, затем запускает новый экземпляр Firefox с помощью диспетчера профилей и в конечном итоге восстанавливает конфигурацию профиля по умолчанию, как только она изменяется. Немного хакерский, но я им пользуюсь и он отлично работает.

Если в Windows вы можете воспроизвести эквивалентный сценарий, но я не могу вам помочь в этом вопросе.

Вот скрипт для сохранения в firefox-other.shфайл и запуска с ./firefox-other.shпомощью терминала или с .desktopфайлом. Возможно, вам придется адаптировать конфигурацию в начале:

#!/bin/bash  # configuration profiles=/home/jerome/.mozilla/firefox/profiles.ini firefox=`which firefox`  # find current default profile profile_regex="\[([^\[]+)\]" name_regex="Name=([^$]+)" default_regex="^Default=1" while read line do [[ $line =~ $name_regex ]] if [[ -n "$" ]] then profile_name="$" fi [[ $line =~ $profile_regex ]] if [[ -n "$" ]] then default_profile="$" fi [[ $line =~ $default_regex ]] if [ -n "$" ] then break fi done < $profiles  echo "Default profile is \"$profile_name\" [$default_profile]" last_update=`stat -c %Y $profiles`  # restore default profile function restore { on_default=0 tmp="$.new" rm -f $tmp while read line do [[ $line =~ $profile_regex ]] if [[ "$" = $default_profile ]] then on_default=1 fi if [[ "$line$on_default" = 1 ]] then echo "Default=1" >> $tmp on_default=0 fi  # echo existing line unless it is the default declaration [[ $line =~ $default_regex ]] if [ -z "$" ] then echo $line >> $tmp fi done < $profiles  mv $tmp $profiles echo "Default profile restored to \"$profile_name\" [$default_profile]" }  # start firefox with profile manager echo -n "Start Firefox..." $firefox -no-remote -P 2> /dev/null 1> /dev/null & pid=$! echo -e "\rFirefox started with pid $pid"  # loop until $profiles is changed or firefox instance killed while true do sleep 1  # watch profiles update=`stat -c %Y $profiles` if [ $update -gt $last_update ] then # profiles updated break fi  # watch instance if [ -n "`kill -0 $pid 2>&1`" ] then # instance terminate break fi  done  # then restore restore 
-1
BZ1

Удалите свои профили и начните заново. Это восстановит профиль по умолчанию. Вы не должны давать этому имя. Когда другие программы открывают веб-страницу в Firefox, она будет использовать этот профиль. Для ваших особых потребностей создайте новые профили и запустите их при помощи переключателя менеджера профилей.

Это не работает Он воссоздал профиль по умолчанию, но все еще имеет ту же проблему, о которой я спрашиваю в посте: когда я выбираю другой (не по умолчанию) профиль из менеджера профилей, он либо устанавливает этот профиль по умолчанию, либо не устанавливает профиль по умолчанию , BrenBarn 11 лет назад 0
-1
Wk_of_Angmar

I will use two profile names for this. "General" is your normal-use profile. "Other" is that JavaScript hacky one. Make sure you use YOUR profile names when following this.

  1. Open profile manager and make sure that "General" is set to the default profile.
  2. Make a copy of your Firefox shortcuts. (So now you have TWO identical Firefox shortcuts).
  3. Rename ONE of the shortcuts to "General", go to right-click -> Properties, and add the following string to the end of the Target:
    -P "General"
  4. Press OK.
  5. Rename the other shortcut to "Other", go to right-click -> Properties, and add the following string to the end of the Target:
    -P "Other" -no-remote
  6. Press OK.

Now you are done. You have two different shortcuts for each profile. Your default profile will be "General" so programs will open shortcuts in that profile. Now for the major advantage: you can use both profiles at the same time! They will open in different instances and windows.

Да, я знаю, что могу это сделать. Но я не хочу создавать отдельные ярлыки для каждого профиля. Как я уже сказал в этом вопросе, я хочу иметь возможность выбирать профиль в диспетчере профилей Firefox, не помечая его как стандартный. BrenBarn 11 лет назад 0
Да, я никогда не догадывался, что кто-то захочет пройти через менеджер профилей. Задумывались ли вы о [надстройке] (https://addons.mozilla.org/en-US/firefox/addon/profileswitcher/) решения для переключения профилей? Wk_of_Angmar 11 лет назад 0
Я думаю, что мог бы, но сами надстройки являются локальными для определенного профиля, так что это не решило бы мою проблему в целом. BrenBarn 11 лет назад 0
-1
Scott R

Similar to what JC2k8 suggested you could alter profiles.ini. My solution is for each shortcut to call a front end batch script.

Shortcut1 - runs batch script that copies file profiles.001, the "general" profile, profilemanger is not enabled.

Shortcut2 - runs batch script that copies file profiles.002 to profiles.ini, which is your setup to prompt WITH profilemanager and launch Firefox asynchronously after waiting lets say 10 secs then copy the "general" profiles.001 back to profile.ini so "general" profile setup is left in place while your running with firefox.exe via using profiles.001 info. As far as I know profiles.ini is used only to initialize Firefox so should be ok changing it when main firefox window has initialized.

Поскольку я прокомментировал другие ответы, я не хочу один ярлык для профиля. Мне нужны ** два ** ярлыка, один для профиля по умолчанию и один, который позволяет мне интерактивно выбирать среди всех других профилей. BrenBarn 9 лет назад 0
хорошо, я перефразировал, чтобы уточнить, что я имел в виду. Я думаю, что будет делать то, что вы хотите. Ваш "общий" профиль всегда установлен по умолчанию. Shortcut2 - единственный раз, когда вы видите Менеджер профилей. Scott R 9 лет назад 0