vivaldi and opera support for incognito links

This commit is contained in:
fourtf 2018-10-16 16:25:48 +02:00
parent d14a4df9e3
commit db4034d2d9

View file

@ -15,18 +15,17 @@ namespace {
// list of command line switches to turn on private browsing in browsers
static auto switches = std::vector<std::pair<QString, QString>>{
{"firefox", "-private-window"}, {"chrome", "-incognito"},
{"vivaldi", "--private"}, {"opera", "-newprivatetab"},
{"iexplore", "-private"},
{"vivaldi", "-incognito"}, {"opera", "-newprivatetab"},
{"opera\\\\launcher", "--private"}, {"iexplore", "-private"},
};
// transform into regex and replacement string
std::vector<std::pair<QRegularExpression, QString>> replacers;
for (const auto &switch_ : switches) {
replacers.emplace_back(
QRegularExpression("(" + switch_.first + "\\.exe\"?).*"),
QRegularExpression("(" + switch_.first + "\\.exe\"?).*",
QRegularExpression::CaseInsensitiveOption),
"\\1 " + switch_.second);
log("(" + switch_.first + "\\.exe\"?).*");
}
// try to find matching regex and apply it