oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.59k stars 237 forks source link

[Feature Request] Open Web Search Terms in Private Window #310

Open moses-bowman opened 4 years ago

moses-bowman commented 4 years ago

image

It would be handy if search terms could optionally be opened in private windows (e.g. Incognito)

oliverschwendener commented 4 years ago

This will be hard, because ueli is just telling the operating system to open the given URL in the default browser. I'm not sure if there is a way to tell the operating system to launch the default browser in incognito/private mode.

danielsteiner commented 4 years ago

I guess this would be doable on windows if you can find out which browser is the default browser. Firefox allows you to open an URL in Private mode with the -private-window URL flag (or just private mode with -private-window), for chrome it is -icognito, for Internet Explorer it would be -private, for chromium edge it is -inprivate and for opera the switch would be --private

Edit: I just looked this up. You can use https://www.npmjs.com/package/winreg to access the registry on windows. The Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.html\UserChoice\ProgID` will show the default handler for .html files (i know, that the .html handler can differ from the http:// handler but in most cases, they're the same and I've simply not yet found the location for the http handler in the registry). The value of ProgId will be one of the following:

based on that key, you can then add the corresponding switch to launch the browser based on it's path, which can as well be determined from the registry. I guess (without taking a look at the code yet) that you're using rundll32 url.dll,FileProtocolHandler to open the default browser on Windows.

CT-66 commented 3 years ago

Are there any updates on this issue?