Add new 'allow-autocompletion' filter
authorFabian Keil <fk@fabiankeil.de>
Thu, 10 Dec 2020 20:10:47 +0000 (21:10 +0100)
committerFabian Keil <fk@fabiankeil.de>
Mon, 18 Jan 2021 13:21:16 +0000 (14:21 +0100)
... which changes autocomplete="off" to "on" on input fields to
allow autocompletion.

Requested by Jamie Zawinski in #370.
Filter based on a submission by Aaron Linville.

default.filter

index 901bb68..031bd17 100644 (file)
@@ -569,6 +569,16 @@ FILTER: no-ping Removes non-standard ping attributes in <a> and <area> tags.
 s@(<a(?:rea)?[^>]*?)\sping=(['"]?)([^"'>]+)\2([>\s]?)@\
 <strong style="color:white; background-color:red;" title="Privoxy removed ping target '$3'">PING!</strong>\n$1$4@ig
 
 s@(<a(?:rea)?[^>]*?)\sping=(['"]?)([^"'>]+)\2([>\s]?)@\
 <strong style="color:white; background-color:red;" title="Privoxy removed ping target '$3'">PING!</strong>\n$1$4@ig
 
+#################################################################################
+#
+# allow-autocompletion: Changes autocomplete="off" on form and input fields
+#                       to "on" to allow autocompletion.
+#
+#################################################################################
+FILTER: allow-autocompletion Changes autocomplete="off" on form and input fields to "on" to allow autocompletion.
+
+s@(<(?:input|form|select|textarea)\s[^>]+autocomplete=)(['"]?)(?:off|0)\2@$1$2on$2@igsU
+
 #################################################################################
 #
 # google: CSS-based block for Google text ads. Also removes
 #################################################################################
 #
 # google: CSS-based block for Google text ads. Also removes