From 8a071dae224ba8952242fbe7ab9b33b8948715b6 Mon Sep 17 00:00:00 2001 From: askepticaldreamer Date: Sun, 15 Jan 2023 12:16:07 -0800 Subject: [PATCH 1/4] Pass link as argument instead of in command string when opening incognito links --- src/util/IncognitoBrowser.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/IncognitoBrowser.cpp b/src/util/IncognitoBrowser.cpp index 377a68918a9..623ad9bc17a 100644 --- a/src/util/IncognitoBrowser.cpp +++ b/src/util/IncognitoBrowser.cpp @@ -74,9 +74,6 @@ QString getCommand(const QString &link) return QString(); } - // link - command += " " + link; - return command; } #endif @@ -100,7 +97,7 @@ bool openLinkIncognito(const QString &link) auto command = getCommand(link); // TODO: split command into program path and incognito argument - return QProcess::startDetached(command, {}); + return QProcess::startDetached(command, {link}); #else return false; #endif From f0d71346d32c79ed9ec6e73f42e39a9dd156c44b Mon Sep 17 00:00:00 2001 From: askepticaldreamer Date: Sun, 15 Jan 2023 12:21:00 -0800 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15238f70ae8..c06af8dfe36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 slashes getting changed to backslashes in url hash when opening links in incognito on windows (#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) From 0e5c5c55265e1cc3ba43d95b9dc5620601ae5afd Mon Sep 17 00:00:00 2001 From: askepticaldreamer Date: Sun, 15 Jan 2023 13:27:22 -0800 Subject: [PATCH 3/4] Make changelog message more user facing --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c06af8dfe36..228298c7e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +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 slashes getting changed to backslashes in url hash when opening links in incognito on windows (#4307) +- 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) From ee9a4e18defbea2c3182f6427e752af8d6d8d4b0 Mon Sep 17 00:00:00 2001 From: askepticaldreamer Date: Sun, 15 Jan 2023 13:29:33 -0800 Subject: [PATCH 4/4] Remove now unused argument for getCommand --- src/util/IncognitoBrowser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/IncognitoBrowser.cpp b/src/util/IncognitoBrowser.cpp index 623ad9bc17a..0092d328423 100644 --- a/src/util/IncognitoBrowser.cpp +++ b/src/util/IncognitoBrowser.cpp @@ -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_" @@ -85,7 +85,7 @@ namespace chatterino { bool supportsIncognitoLinks() { #ifdef Q_OS_WIN - return !getCommand("").isNull(); + return !getCommand().isNull(); #else return false; #endif @@ -94,7 +94,7 @@ 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, {link});