Fixes
This commit is contained in:
parent
1a60367c0a
commit
a8d7965c43
|
@ -340,6 +340,16 @@ function main() {
|
|||
// })
|
||||
// );
|
||||
|
||||
section.appendChild(
|
||||
createSwitch(
|
||||
"Allow audio from your mic (and audio you pass through) to become stereo",
|
||||
await userscript.getBoolPref("stereoMic", false),
|
||||
(enabled) => {
|
||||
userscript.setStereoMic(enabled);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
section.appendChild(
|
||||
createSwitch(
|
||||
"Move discord-awesomeaudio to the system tray instead of closing",
|
||||
|
|
|
@ -18,8 +18,22 @@
|
|||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QWebEngineFullScreenRequest>
|
||||
#include <QWebEngineProfile>
|
||||
#include <QWebEngineUrlRequestInterceptor>
|
||||
#include <QWidget>
|
||||
|
||||
// Custom network interceptor class
|
||||
class NetworkInterceptor : public QWebEngineUrlRequestInterceptor {
|
||||
public:
|
||||
NetworkInterceptor(QObject* parent = nullptr) : QWebEngineUrlRequestInterceptor(parent) {}
|
||||
|
||||
void interceptRequest(QWebEngineUrlRequestInfo& info) override {
|
||||
// Modify the request headers here as needed
|
||||
info.setHttpHeader("Access-Control-Allow-Origin", "*");
|
||||
info.setHttpHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
||||
}
|
||||
};
|
||||
|
||||
MainWindow *MainWindow::m_instance = nullptr;
|
||||
|
||||
MainWindow::MainWindow(bool useNotifySend, QWidget *parent)
|
||||
|
@ -30,6 +44,11 @@ MainWindow::MainWindow(bool useNotifySend, QWidget *parent)
|
|||
m_settings->setValue("useNotifySend", useNotifySend);
|
||||
m_centralWidget = new CentralWidget(this);
|
||||
setCentralWidget(m_centralWidget);
|
||||
|
||||
// Create and install the network interceptor
|
||||
NetworkInterceptor* networkInterceptor = new NetworkInterceptor(this);
|
||||
QWebEngineProfile::defaultProfile()->setRequestInterceptor(networkInterceptor);
|
||||
|
||||
setupTrayIcon();
|
||||
setMinimumSize(800, 300);
|
||||
connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this),
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <QSystemTrayIcon>
|
||||
#include <QVBoxLayout>
|
||||
#include <QVector>
|
||||
#include <QWebEngineUrlRequestInterceptor>
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
@ -24,7 +25,6 @@ private:
|
|||
void setupTrayIcon();
|
||||
void cleanTrayIcon();
|
||||
void setupSettings();
|
||||
QWebEngineProfile *prepareProfile();
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
QSystemTrayIcon *m_trayIcon = nullptr;
|
||||
QMenu *m_trayIconMenu;
|
||||
|
|
Loading…
Reference in New Issue