zumoshi / BrowserSelect

Browser Select is a utility to dynamically select the browser you want instead of just having one default for all links.
GNU General Public License v2.0
291 stars 39 forks source link

Opera (blink) doesn't start in Private/Incognito mode #35

Closed MailYouLater closed 6 years ago

MailYouLater commented 6 years ago

Hello again, Thanks for being so quick with fixing my other issues, and sorry I didn't get this one in before you released 1.3.9 the other day...

BrowserSelect won't launch Opera 52 in private/incognito mode when holding Shift or Alt as it does for the other browsers I've been using.

Apparently Opera doesn't respond to the documented "Unix" and/or "Mac" versions of the "Command Line Options", so what BrowserSelect is currently using (-newprivatetab) doesn't work. Unfortunately, the Opera documentation is out of date and doesn't show how to launch it in private mode on Windows. I did some experimenting though, and it does open a new private window when launched with -private like this:

C:\Program Files\Opera\launcher.exe -private http://url.goes/here

I look forward to seeing this fixed in a future version.

zumoshi commented 6 years ago

hi, thanks for your report.

passing -private to opera opens the link in a new window, not a new tab (in case there are already other private tabs open).

also, I think pre-blink versions accept the old flag, so changing it would prevent users with an older opera version from opening links in private tabs.

otherwise seems to be an easy fix by changing only a single line of code.

are there any other flags that can open the link in a new tab? or maybe we should try opening an issue on their side for inaccurate documentation to see if they will update the docs or fix the flag so it would work?

MailYouLater commented 6 years ago

You're right, just checked, and -newprivatetab does work on Opera 12.x, and I know there are still people using it.

Also I just realized that BrowserSelect isn't currently launching Opera with -newprivatetab when holding Shift/Alt. It's actually running the newer versions of Opera with -private-window, because the way you choose which parameter to use is based on the name of the exe file listed in (both HKLM and HKCU versions) of the Software\Clients\StartMenuInternet\*\shell\open\command key's default value, ignoring the path that it's in, and the blink versions of Opera use Launcher.exe, so you can fix this without breaking it for old versions of opera by adding a check for launcher as follows:

if (file.Contains("launcher"))
    return "-private";

On another note, I did try reporting the issue to Opera, and the response I got simply stated that the documentation I was looking at was out of date and that they're working on fixing it, but I doubt it's high on their priority list since it's literally been years since it was accurate. I would recommend that you try reporting it too though, maybe they'll take it more seriously if a developer is trying to use the documentation.

Also, if you use -private for now, and they do eventually add a CLI option to open a new private tab in the same window (and hopefully update their documentation), you can choose if you want to switch to that method when it becomes known.

MailYouLater commented 6 years ago

Any update on what your plans are regarding this issue?

zumoshi commented 6 years ago

@MailYouLater sorry for the delay, fixed in v1.4

MailYouLater commented 6 years ago

Thanks. Works perfectly. Sorry I didn't get back to let you know the fix worked earlier. I didn't get notified about the update. I'm submitting a bug report about that: #43