Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Firfox profiles #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

perqin
Copy link

@perqin perqin commented Nov 11, 2020

See here for official documentation on Firefox profiles management.

Copy link
Owner

@zumoshi zumoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thanks for your contribution.

A few points:

  1. Please add the extra dependency to the setup file so it would include the dll file:
    https://github.com/zumoshi/BrowserSelect/blob/master/BrowserSelect/installer.nsi#L40

  2. As I mentioned in the comment, you need to also commit the csproj file

  3. I get 2 firefoxes on a default installation before creating any profiles
    image
    Perhaps you have to remove one like I did for chrome?

  4. I'm not very familiar with how firefox profiles work so I may be doing something wrong but the app seems to lag behind one profile? (as in I create the profile, browserselect won't pick it up, I create another profile, it picks up the previous one)
    image
    image
    I did run firefox with the new profile before clicking on refresh browsers from settings.

There are also some unlabeled firefox icons (without any profile name)

  1. If there are two firefox instances (of different profiles) open, trying to open a link in one of them just opens a new firefox window with no link

This feature was brought up in #14 but I didn't find any way to communicate with open instances to open a new tab in a specific profile which is why this wasn't implemented.

Which command-line flags are you using to open the link in a new tab of a running instance of a certain profile in firefox?

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ini-parser" version="2.5.2" targetFramework="net40" />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also include changes to the .csproj file, specifically this addition:

<Reference Include="INIFileParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL">
      <HintPath>..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll</HintPath>
    </Reference>

Otherwise it won't compile
image

@zumoshi
Copy link
Owner

zumoshi commented Nov 11, 2020

Running a few more tests it seems firefox now correctly handles -p profile link. Interesting, It didn't do that before.
We need to do some tests to detect which version has introduced this change and either auto-detect it or provide an option in case someone is still using a pre-Quantum firefox version.

The weird behavior of opening a new window without a link seems to have something to do with how Program.Args2Str escapes the arguments:
image

That still doesn't explain the missing profile names though.
But since there is now support in firefox for this I will merge it as soon as the issues are resolved.

@perqin
Copy link
Author

perqin commented Nov 12, 2020

I'll try resolving these issue later. It seems that there are some problems on Firefox handling link in specified profile.

@lucasnz
Copy link

lucasnz commented Feb 16, 2021

This seems to work consistently for me:
firefox.exe -P default -new-tab "http://www.example.com"
See:
https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-new-tab_url

This option seems to have been around for a while now (seems to have worked back in Jan 2020) for this user;
https://stackoverflow.com/a/59889290

Adding the new-tab parameter may ensure better (backward) support??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants