~sircmpwn/himitsu-devel

himitsu-firefox: Match on elements ids as well as names v1 REJECTED

Alexey Yerin: 1
 Match on elements ids as well as names

 1 files changed, 8 insertions(+), 3 deletions(-)
#781124 .build.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/himitsu-devel/patches/33026/mbox | git am -3
Learn more about email & git

[PATCH himitsu-firefox] Match on elements ids as well as names Export this patch

Some websites only use an id (e.g. PeerTube)
---
 content/content.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/content/content.js b/content/content.js
index b26609f..ee860fb 100644
--- a/content/content.js
+++ b/content/content.js
@@ -15,7 +15,11 @@ function handleAutofill(msg) {
		if (pair.key === "proto" || pair.key === "host") {
			return;
		};
		const input = form.querySelector(`input[name="${pair.key}"]`);
		let input = form.querySelector(`input[name="${pair.key}"]`);
		if (input === null) {
			input = form.querySelector(`input#${pair.key}`);
			input.value = pair.value;
		}
		input.value = pair.value;
	});
}
@@ -32,8 +36,9 @@ function findForm(key) {
			if (pair.optional) {
				return;
			}
			const input = form.querySelector(`input[name="${pair.key}"]`);
			if (input === null) {
			const input1 = form.querySelector(`input[name="${pair.key}"]`);
			const input2 = form.querySelector(`input#${pair.key}`);
			if (input1 === null && input2 === null) {
				valid = false;
			}
		});
-- 
2.36.1
himitsu-firefox/patches/.build.yml: FAILED in 16s

[Match on elements ids as well as names][0] from [Alexey Yerin][1]

[0]: https://lists.sr.ht/~sircmpwn/himitsu-devel/patches/33026
[1]: mailto:yyp@disroot.org

✗ #781124 FAILED himitsu-firefox/patches/.build.yml https://builds.sr.ht/~sircmpwn/job/781124
Hm, NACK for now. This is, in my view, a bug with the website. Should
send a patch to PeerTube for it.