Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9faabe1f3e | ||
|
|
68473d04d8 | ||
|
|
7c8f72b8d8 | ||
|
|
27cdd9f9a5 |
@@ -183,14 +183,21 @@ setInterval(() => {
|
|||||||
el.appendChild(div);
|
el.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
const muteBtn = document.getElementsByClassName(
|
const buttonContainer = document.getElementsByClassName("container-YkUktl")[0];
|
||||||
|
if (!buttonContainer) {
|
||||||
|
console.log('dsa: Cannot locate Mute/Deafen/Settings button container, please report this on GitHub');
|
||||||
|
}
|
||||||
|
|
||||||
|
const muteBtn = buttonContainer ? buttonContainer.getElementsByClassName(
|
||||||
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
||||||
)[0];
|
)[0] : null;
|
||||||
window.discordScreenaudioToggleMute = () => muteBtn.click();
|
window.discordScreenaudioToggleMute = () => muteBtn && muteBtn.click();
|
||||||
const deafenBtn = document.getElementsByClassName(
|
|
||||||
|
const deafenBtn = buttonContainer ? buttonContainer.getElementsByClassName(
|
||||||
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
||||||
)[1];
|
)[1] : null;
|
||||||
window.discordScreenaudioToggleDeafen = () => deafenBtn.click();
|
|
||||||
|
window.discordScreenaudioToggleDeafen = () => deafenBtn && deafenBtn.click();
|
||||||
|
|
||||||
if (window.discordScreenaudioResolutionString) {
|
if (window.discordScreenaudioResolutionString) {
|
||||||
for (const el of document.getElementsByClassName(
|
for (const el of document.getElementsByClassName(
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QNetworkReply>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWebChannel>
|
#include <QWebChannel>
|
||||||
#include <QWebEngineScript>
|
#include <QWebEngineScript>
|
||||||
@@ -128,14 +129,13 @@ void DiscordPage::injectScriptText(QString name, QString content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DiscordPage::injectScriptFile(QString name, QString source) {
|
void DiscordPage::injectScriptFile(QString name, QString source) {
|
||||||
QFile userscript(source);
|
QFile file(source);
|
||||||
|
|
||||||
if (!userscript.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
qFatal("Failed to load %s with error: %s", source.toLatin1().constData(),
|
qFatal("Failed to load %s with error: %s", source.toLatin1().constData(),
|
||||||
userscript.errorString().toLatin1().constData());
|
file.errorString().toLatin1().constData());
|
||||||
} else {
|
} else {
|
||||||
QByteArray userscriptJs = userscript.readAll();
|
injectScriptText(name, file.readAll());
|
||||||
injectScriptText(name, userscriptJs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ private:
|
|||||||
javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level,
|
javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level,
|
||||||
const QString &message, int lineNumber,
|
const QString &message, int lineNumber,
|
||||||
const QString &sourceID) override;
|
const QString &sourceID) override;
|
||||||
void injectScriptText(QString name, QString source);
|
void injectScriptText(QString name, QString content);
|
||||||
void injectScriptFile(QString name, QString content);
|
void injectScriptFile(QString name, QString source);
|
||||||
void stopVirtmic();
|
void stopVirtmic();
|
||||||
void startVirtmic(QString target);
|
void startVirtmic(QString target);
|
||||||
void toggleMute();
|
void toggleMute();
|
||||||
|
|||||||
Reference in New Issue
Block a user