mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
vivaldi and opera support for incognito links
This commit is contained in:
parent
d14a4df9e3
commit
db4034d2d9
|
@ -14,19 +14,18 @@ namespace {
|
||||||
{
|
{
|
||||||
// list of command line switches to turn on private browsing in browsers
|
// list of command line switches to turn on private browsing in browsers
|
||||||
static auto switches = std::vector<std::pair<QString, QString>>{
|
static auto switches = std::vector<std::pair<QString, QString>>{
|
||||||
{"firefox", "-private-window"}, {"chrome", "-incognito"},
|
{"firefox", "-private-window"}, {"chrome", "-incognito"},
|
||||||
{"vivaldi", "--private"}, {"opera", "-newprivatetab"},
|
{"vivaldi", "-incognito"}, {"opera", "-newprivatetab"},
|
||||||
{"iexplore", "-private"},
|
{"opera\\\\launcher", "--private"}, {"iexplore", "-private"},
|
||||||
};
|
};
|
||||||
|
|
||||||
// transform into regex and replacement string
|
// transform into regex and replacement string
|
||||||
std::vector<std::pair<QRegularExpression, QString>> replacers;
|
std::vector<std::pair<QRegularExpression, QString>> replacers;
|
||||||
for (const auto &switch_ : switches) {
|
for (const auto &switch_ : switches) {
|
||||||
replacers.emplace_back(
|
replacers.emplace_back(
|
||||||
QRegularExpression("(" + switch_.first + "\\.exe\"?).*"),
|
QRegularExpression("(" + switch_.first + "\\.exe\"?).*",
|
||||||
|
QRegularExpression::CaseInsensitiveOption),
|
||||||
"\\1 " + switch_.second);
|
"\\1 " + switch_.second);
|
||||||
|
|
||||||
log("(" + switch_.first + "\\.exe\"?).*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to find matching regex and apply it
|
// try to find matching regex and apply it
|
||||||
|
|
Loading…
Reference in a new issue