fix remote debugging

This commit is contained in:
Malte Jürgens 2022-08-01 19:59:01 +02:00
parent af107168db
commit 95d391e869
2 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,5 @@
#include "main.h"
#include "mainwindow.h"
#include "virtmic.h"
@ -20,10 +22,9 @@ int main(int argc, char *argv[]) {
QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone",
"target");
parser.addOption(virtmicOption);
#ifdef DEBUG
parser.addOption(QCommandLineOption(
"remote-debugging-port", "Chromium Remote Debugging Port", "port"));
#endif
QCommandLineOption degubOption("remote-debugging",
"Open Chromium Remote Debugging on port 9222");
parser.addOption(degubOption);
parser.process(app);
if (parser.isSet(virtmicOption)) {
@ -34,6 +35,11 @@ int main(int argc, char *argv[]) {
"--enable-features=WebRTCPipeWireCapturer " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
if (parser.isSet(degubOption))
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
"--remote-debugging-port=9222 " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
MainWindow w;
w.show();

6
src/main.h Normal file
View file

@ -0,0 +1,6 @@
#pragma once
#include <QString>
int main(int argc, char *argv[]);
void addToEnvVar(const char *var, const char *val);