Last active
November 2, 2020 14:23
-
-
Save ddebin/19b0c5a1078d5f9156eff32165e595f9 to your computer and use it in GitHub Desktop.
Remplissage automatique (bookmarklet) pour l'attestation de déplacement https://media.interieur.gouv.fr/deplacement-covid-19/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (() => { | |
const now = new Date(Date.now() + 5 * 60 * 1000 /* délai de 5min en ms */); | |
/* modifiez les champs suivants avec vos informations */ | |
const fields = { | |
"field-firstname": "Camille", | |
"field-lastname": "Dupont", | |
"field-birthday": "01/01/1970", | |
"field-placeofbirth": "Paris", | |
"field-address": "999 avenue de France", | |
"field-city": "Paris", | |
"field-zipcode": "75001", | |
"field-heuresortie": now.toTimeString().substr(0, 5) | |
}; | |
const checkboxes = [ | |
"checkbox-travail", | |
"checkbox-achats" | |
]; | |
Object.entries(fields).forEach( | |
([field, value]) => (document.querySelector("#" + field).value = value) | |
); | |
checkboxes.forEach( | |
(checkbox) => (document.querySelector("#" + checkbox).checked = "checked") | |
); | |
document.querySelector("#generate-btn").click(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
À mettre dans un raccourci Chrome ou Safari et à exécuter une fois sur la page de l'attestation.