-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Open URLs in Private Mode / Incognito #9694
base: develop
Are you sure you want to change the base?
Open URLs in Private Mode / Incognito #9694
Conversation
.arg(url.scheme()); | ||
QSettings defaultBrowserRegistry(registryPath, QSettings::NativeFormat); | ||
auto defaultBrowser = defaultBrowserRegistry.value("ProgId").toString(); | ||
if (defaultBrowser.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible for UserChoice not to exist, then you must find the progid the classic way.
} | ||
|
||
// Get the executable path from program ID | ||
registryPath = QString("HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\%1\\shell\\open\\command").arg(defaultBrowser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HKEY_CLASSES_ROOT
@@ -142,6 +142,34 @@ bool WinUtils::isHighContrastMode() const | |||
return (settings.value("Flags").toInt() & 1u) != 0; | |||
} | |||
|
|||
QString WinUtils::getDefaultApplicationForUrl(const QUrl& url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for this incorrect registry handling, just call AssocQueryStringW(ASSOCF_NOTRUNCATE | ASSOCF_INIT_IGNOREUNKNOWN, ASSOCSTR_EXECUTABLE, L"http", 0, ...)
Adds a new menu item and keyboard shortcut for opening a URL using Private Mode / Incognito with the operating system default browser.
xdg-settings
NSWorkspace::URLForApplicationToOpenURL()
callWith Firefox based browsers Firefox itself and Librewolf are detected automatically to use
-private-window
command line parameter. Chromium-based browsers will use-incognito
Fixes #9468.
Testing strategy
Manually.
Type of change