diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-10-04 16:48:54 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-10-04 20:14:05 +0300 |
commit | db3c9c8d3b5903b353bca2fa349d3386c1f68096 (patch) | |
tree | 53775743b0f1ec64c271175f595d06502ea1bcaf /src/wallet | |
parent | Remove outparam section in Configuration parse (diff) | |
download | smolbote-db3c9c8d3b5903b353bca2fa349d3386c1f68096.tar.xz |
Remove Breakpad optdepend
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 35 | ||||
-rw-r--r-- | src/wallet/wallet.h | 18 |
2 files changed, 0 insertions, 53 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp deleted file mode 100644 index 5023ea4..0000000 --- a/src/wallet/wallet.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#include "wallet.h" -#include <QWebEngineView> -#include <QWebEngineScript> - -void Wallet::autocompleteForm(QWebEngineView *view) -{ - const auto findFormFunction = QLatin1String("index = undefined; for(var i = 0; i < document.forms.length; ++i) { if(document.forms[i].autocomplete) { index = i } }; index"); - - view->page()->runJavaScript(findFormFunction, QWebEngineScript::ApplicationWorld, [view](const QVariant &v) { - if(!v.isNull()) { - const QString username = "test-username"; - const QString password = "test-password"; - - auto autofillFunction = QString("inputs = document.forms[%1].getElementsByTagName('input');" - "for(var i = 0; i < inputs.length; ++i) {" - " if(inputs[i].type == 'username') { inputs[i].value='username' }" - " else if(inputs[i].type == 'email') { inputs[i].value='%2' }" - " else if(inputs[i].type == 'password') { inputs[i].value='%3' }" - " else { inputs[i].value=inputs[i].type }" - "}") - .arg(v.toString(), username, password); - // TODO - // for page->url() get list of pairs type = value - view->page()->runJavaScript(autofillFunction, QWebEngineScript::ApplicationWorld); - } - }); -} diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h deleted file mode 100644 index d2fdb71..0000000 --- a/src/wallet/wallet.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#ifndef SMOLBOTE_WALLET_H -#define SMOLBOTE_WALLET_H - -class QWebEngineView; - -namespace Wallet { - void autocompleteForm(QWebEngineView *view); -} - -#endif // SMOLBOTE_WALLET_H |