mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
attach extension to opera/vivaldi or all windows
This commit is contained in:
parent
2fc799f85a
commit
f25e52b218
|
@ -214,6 +214,8 @@ public:
|
|||
|
||||
QStringSetting cachePath = {"/cache/path", ""};
|
||||
BoolSetting restartOnCrash = {"/misc/restartOnCrash", false};
|
||||
BoolSetting attachExtensionToAnyProcess = {
|
||||
"/misc/attachExtensionToAnyProcess", false};
|
||||
|
||||
/// Debug
|
||||
BoolSetting showUnhandledIrcMessages = {"/debug/showUnhandledIrcMessages",
|
||||
|
|
|
@ -180,14 +180,20 @@ void AttachedWindow::attachToHwnd(void *_attachedPtr)
|
|||
QString qfilename =
|
||||
QString::fromWCharArray(filename.get(), int(filenameLength));
|
||||
|
||||
if (!getSettings()->attachExtensionToAnyProcess)
|
||||
{
|
||||
// We don't attach to non-browser processes by default.
|
||||
if (!qfilename.endsWith("chrome.exe") &&
|
||||
!qfilename.endsWith("firefox.exe"))
|
||||
!qfilename.endsWith("firefox.exe") &&
|
||||
!qfilename.endsWith("vivaldi.exe") &&
|
||||
!qfilename.endsWith("opera.exe"))
|
||||
{
|
||||
qDebug() << "NM Illegal caller" << qfilename;
|
||||
this->timer_.stop();
|
||||
this->deleteLater();
|
||||
return;
|
||||
}
|
||||
}
|
||||
this->validProcessName_ = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -439,10 +439,16 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||
layout.addDescription("The browser extension replaces the default "
|
||||
"Twitch.tv chat with chatterino.");
|
||||
|
||||
layout.addDescription(formatRichNamedLink(CHROME_EXTENSION_LINK,
|
||||
"Download for Google Chrome"));
|
||||
layout.addDescription(formatRichNamedLink(
|
||||
CHROME_EXTENSION_LINK,
|
||||
"Download for Google Chrome and similar browsers."));
|
||||
layout.addDescription(
|
||||
formatRichNamedLink(FIREFOX_EXTENSION_LINK, "Download for Firefox"));
|
||||
|
||||
layout.addDescription("Chatterino only attaches to known browsers to avoid "
|
||||
"attaching to other windows by accident.");
|
||||
layout.addCheckbox("Attach to any browser (may cause issues).",
|
||||
s.attachExtensionToAnyProcess);
|
||||
#endif
|
||||
|
||||
layout.addTitle("Miscellaneous");
|
||||
|
|
Loading…
Reference in a new issue