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

Fix slash to backslash conversions in url hashes for opening links in incognito #4307

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Bugfix: Fixed crash that could occur when closing down a split at the wrong time. (#4277)
- Bugfix: Fixed crash that could occur when closing down the last of a channel when reloading emotes. (#4278)
- Bugfix: Fixed scrollbar highlight colors when changing message history limit. (#4288)
- Bugfix: Fixed an issue on Windows when opening links in incognito mode that contained forward slashes in hash (#4307)
- Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256)
- Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198)
- Dev: Migrated to C++ 20 (#4252, #4257)
Expand Down
11 changes: 4 additions & 7 deletions src/util/IncognitoBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ QString injectPrivateSwitch(QString command)
return QString();
}

QString getCommand(const QString &link)
QString getCommand()
{
// get default browser prog id
auto browserId = QSettings("HKEY_CURRENT_"
Expand Down Expand Up @@ -74,9 +74,6 @@ QString getCommand(const QString &link)
return QString();
}

// link
command += " " + link;

return command;
}
#endif
Expand All @@ -88,7 +85,7 @@ namespace chatterino {
bool supportsIncognitoLinks()
{
#ifdef Q_OS_WIN
return !getCommand("").isNull();
return !getCommand().isNull();
#else
return false;
#endif
Expand All @@ -97,10 +94,10 @@ bool supportsIncognitoLinks()
bool openLinkIncognito(const QString &link)
{
#ifdef Q_OS_WIN
auto command = getCommand(link);
auto command = getCommand();

// TODO: split command into program path and incognito argument
return QProcess::startDetached(command, {});
return QProcess::startDetached(command, {link});
#else
return false;
#endif
Expand Down