new package: falkon
This commit is contained in:
parent
98de11b1f8
commit
45e17b0d4c
|
@ -0,0 +1,155 @@
|
|||
From 27c59ed16a621c0e144b562eb6dfdf46c39a1ce4 Mon Sep 17 00:00:00 2001
|
||||
From: Juraj Oravec <jurajoravec@mailo.com>
|
||||
Date: Tue, 17 Oct 2023 21:39:13 +0200
|
||||
Subject: [PATCH] =?UTF-8?q?Fix=20form=20detection=20for=20password=20manag?=
|
||||
=?UTF-8?q?er=C3=A4?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Original Author: Davide
|
||||
|
||||
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
|
||||
---
|
||||
src/lib/tools/scripts.cpp | 111 +++++++++++++++++++++++++-------------
|
||||
1 file changed, 74 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/src/lib/tools/scripts.cpp b/src/lib/tools/scripts.cpp
|
||||
index 02bc77b1d..9a0e5da90 100644
|
||||
--- a/src/lib/tools/scripts.cpp
|
||||
+++ b/src/lib/tools/scripts.cpp
|
||||
@@ -74,31 +74,37 @@ QString Scripts::setupWebChannel()
|
||||
QString Scripts::setupFormObserver()
|
||||
{
|
||||
QString source = QL1S("(function() {"
|
||||
- "function findUsername(inputs) {"
|
||||
- " var usernameNames = ['user', 'name', 'login'];"
|
||||
- " for (var i = 0; i < usernameNames.length; ++i) {"
|
||||
- " for (var j = 0; j < inputs.length; ++j)"
|
||||
- " if (inputs[j].type == 'text' && inputs[j].value.length && inputs[j].name.indexOf(usernameNames[i]) != -1)"
|
||||
- " return inputs[j].value;"
|
||||
+ " let eFormsOld = [],"
|
||||
+ " eFormsDone = [];"
|
||||
+ ""
|
||||
+ " function findUsername(inputs) {"
|
||||
+ " let usernameNames = ['user', 'name', 'login'];"
|
||||
+ ""
|
||||
+ " for (let i = 0; i < usernameNames.length; ++i) {"
|
||||
+ " for (let j = 0; j < inputs.length; ++j)"
|
||||
+ " if (inputs[j].type == 'text' && inputs[j].value.length && inputs[j].name.indexOf(usernameNames[i]) != -1)"
|
||||
+ " return inputs[j].value;"
|
||||
+ " }"
|
||||
+ ""
|
||||
+ " for (let i = 0; i < inputs.length; ++i)"
|
||||
+ " if (inputs[i].type == 'text' && inputs[i].value.length)"
|
||||
+ " return inputs[i].value;"
|
||||
+ ""
|
||||
+ " for (let i = 0; i < inputs.length; ++i)"
|
||||
+ " if (inputs[i].type == 'email' && inputs[i].value.length)"
|
||||
+ " return inputs[i].value;"
|
||||
+ ""
|
||||
+ " return '';"
|
||||
" }"
|
||||
- " for (var i = 0; i < inputs.length; ++i)"
|
||||
- " if (inputs[i].type == 'text' && inputs[i].value.length)"
|
||||
- " return inputs[i].value;"
|
||||
- " for (var i = 0; i < inputs.length; ++i)"
|
||||
- " if (inputs[i].type == 'email' && inputs[i].value.length)"
|
||||
- " return inputs[i].value;"
|
||||
- " return '';"
|
||||
- "}"
|
||||
""
|
||||
- "function registerForm(form) {"
|
||||
- " form.addEventListener('submit', function() {"
|
||||
- " var form = this;"
|
||||
- " var data = '';"
|
||||
- " var password = '';"
|
||||
- " var inputs = form.getElementsByTagName('input');"
|
||||
- " for (var i = 0; i < inputs.length; ++i) {"
|
||||
- " var input = inputs[i];"
|
||||
- " var type = input.type.toLowerCase();"
|
||||
+ " function processForm(eForm) {"
|
||||
+ " let data = '';"
|
||||
+ " let password = '';"
|
||||
+ " let inputs = eForm.getElementsByTagName('input');"
|
||||
+ ""
|
||||
+ " for (let i = 0; i < inputs.length; ++i) {"
|
||||
+ " let input = inputs[i];"
|
||||
+ " let type = input.type.toLowerCase();"
|
||||
" if (type != 'text' && type != 'password' && type != 'email')"
|
||||
" continue;"
|
||||
" if (!password && type == 'password')"
|
||||
@@ -108,28 +114,59 @@ QString Scripts::setupFormObserver()
|
||||
" data += encodeURIComponent(input.value);"
|
||||
" data += '&';"
|
||||
" }"
|
||||
+ ""
|
||||
" if (!password)"
|
||||
" return;"
|
||||
+ ""
|
||||
+ " if (eFormsDone.every(e => e != eForm)) {"
|
||||
+ " eFormsDone.push(eForm);"
|
||||
+ " } else {"
|
||||
+ " return;"
|
||||
+ " }"
|
||||
+ ""
|
||||
" data = data.substring(0, data.length - 1);"
|
||||
- " var url = window.location.href;"
|
||||
- " var username = findUsername(inputs);"
|
||||
+ " let url = window.location.href;"
|
||||
+ " let username = findUsername(inputs);"
|
||||
" external.autoFill.formSubmitted(url, username, password, data);"
|
||||
- " }, true);"
|
||||
- "}"
|
||||
+ " }"
|
||||
""
|
||||
- "if (!document.documentElement) return;"
|
||||
+ " function undoForm(eForm) {"
|
||||
+ " let i = eFormsDone.indexOf(eForm);"
|
||||
+ ""
|
||||
+ " if (i >= 0) {"
|
||||
+ " eFormsDone.splice(i, 1);"
|
||||
+ " }"
|
||||
+ " }"
|
||||
+ ""
|
||||
+ " function registerForm(eForm) {"
|
||||
+ " let eInputs = eForm.getElementsByTagName('input');"
|
||||
+ ""
|
||||
+ " eForm.addEventListener('submit', () => processForm(eForm), true);"
|
||||
+ ""
|
||||
+ " for (let eInput of eInputs) {"
|
||||
+ " let type = eInput.type.toLowerCase();"
|
||||
+ " "
|
||||
+ " if (type == 'password') {"
|
||||
+ " eInput.addEventListener('blur', () => processForm(eForm), true);"
|
||||
+ " eInput.addEventListener('input', () => undoForm(eForm), true);"
|
||||
+ " eInput.addEventListener('keydown', () => event.keyCode === 13 && processForm(eForm), true);"
|
||||
+ " }"
|
||||
+ " }"
|
||||
+ " }"
|
||||
""
|
||||
- "for (var i = 0; i < document.forms.length; ++i)"
|
||||
- " registerForm(document.forms[i]);"
|
||||
+ " setInterval(() => {"
|
||||
+ " try {"
|
||||
+ " let eFormsNew = Array.from(document.forms);"
|
||||
""
|
||||
- "var observer = new MutationObserver(function(mutations) {"
|
||||
- " for (var mutation of mutations)"
|
||||
- " for (var node of mutation.addedNodes)"
|
||||
- " if (node.tagName && node.tagName.toLowerCase() == 'form')"
|
||||
- " registerForm(node);"
|
||||
- "});"
|
||||
- "observer.observe(document.documentElement, { childList: true, subtree: true });"
|
||||
+ " for (let eFormNew of eFormsNew) {"
|
||||
+ " if (eFormsOld.every(e => e != eFormNew)) {"
|
||||
+ " eFormsOld.push(eFormNew);"
|
||||
+ " registerForm(eFormNew);"
|
||||
+ " }"
|
||||
+ " }"
|
||||
""
|
||||
+ " } catch (e) {}"
|
||||
+ " }, 100);"
|
||||
"})()");
|
||||
|
||||
return source;
|
|
@ -0,0 +1,23 @@
|
|||
From bfba0a5d5e998a7cc9f0bc4628a033a56e3828ff Mon Sep 17 00:00:00 2001
|
||||
From: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
|
||||
Date: Thu, 7 Dec 2023 12:07:19 -0300
|
||||
Subject: [PATCH] MainApplication: Enable localStorage for private
|
||||
|
||||
Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
|
||||
---
|
||||
src/lib/app/mainapplication.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp
|
||||
index 403c304dc..4d0cecd97 100644
|
||||
--- a/src/lib/app/mainapplication.cpp
|
||||
+++ b/src/lib/app/mainapplication.cpp
|
||||
@@ -1024,7 +1024,7 @@ void MainApplication::loadSettings()
|
||||
settings.endGroup();
|
||||
|
||||
if (isPrivate()) {
|
||||
- webSettings->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
|
||||
+ profile->setPersistentStoragePath(DataPaths::path(DataPaths::Temp) + QLatin1String("/private-storage"));
|
||||
history()->setSaving(false);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
TERMUX_PKG_HOMEPAGE=https://www.falkon.org/
|
||||
TERMUX_PKG_DESCRIPTION="Cross-platform Qt-based web browser"
|
||||
TERMUX_PKG_LICENSE="GPL-3.0"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION="23.08.4"
|
||||
TERMUX_PKG_SRCURL=https://download.kde.org/stable/release-service/$TERMUX_PKG_VERSION/src/falkon-$TERMUX_PKG_VERSION.tar.xz
|
||||
TERMUX_PKG_SHA256=f08484b768ccc7cfc097d473c1ccc66986f839f79b5f3516a9aeba4ee7286d63
|
||||
TERMUX_PKG_DEPENDS="karchive, qt5-qtsvg, qt5-qtwebchannel, qt5-qtwebengine, qt5-qtx11extras"
|
||||
|
||||
termux_step_post_get_source() {
|
||||
# Do not include i18n contents
|
||||
rm -r po
|
||||
}
|
Loading…
Reference in New Issue