Browse Source

autocomplete input

master
Tjiho 4 months ago
parent
commit
ae1929239a
3 changed files with 38 additions and 0 deletions
  1. BIN
      icons/red-cross.png
  2. +18
    -0
      main.js
  3. +20
    -0
      manifest.json

BIN
icons/red-cross.png View File

Before After
Width: 48  |  Height: 48  |  Size: 408 B

+ 18
- 0
main.js View File

@ -0,0 +1,18 @@
const fields_to_autocomplete = ['famount-once','email','civility','firstname','lastname','address1','address2','postcode','city','reserved_telephone','reserved_birthdate','cardnumber']
const values_to_put_in_fields = ['19','**.**@laposte.net','1','Tom','Darboux','***','', 31000, 'toulouse','****','****-**-**','****************']
for (field_index in fields_to_autocomplete) {
const field = document.getElementById(fields_to_autocomplete[field_index])
switch (field.nodeName) {
case "SELECT":
console.log('select not supported yet')
break;
case "INPUT":
field.value=values_to_put_in_fields[field_index]
break;
default:
}
}

+ 20
- 0
manifest.json View File

@ -0,0 +1,20 @@
{
"manifest_version": 2,
"name": "Borderify",
"version": "1.0",
"description": "Adds a red border to all webpages matching mozilla.org.",
"icons": {
"48": "icons/red-cross.png"
},
"content_scripts": [
{
"matches": ["*://donner.croix-rouge.fr/*"],
"js": ["main.js"]
}
]
}

Loading…
Cancel
Save