Add script for Auchan Drive

master
Guillaume Dott 2019-02-13 14:41:41 +01:00
parent 3fc858e957
commit caa53ec246
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// ==UserScript==
// @name Auchan Drive allergies
// @namespace http://amnesix.eu
// @description Affiche une alerte lorsqu'un produit contient un des ingrédients interdits
// @include https://www.auchandrive.fr/*
// @include http://www.auchandrive.fr/*
// @version 0.1
// @grant none
// @require https://code.amnesix.eu/guillaume/allergies-userscripts/raw/branch/master/Allergies-1.1.js
// ==/UserScript==
(function() {
var ingredients = Array.from(document.querySelectorAll('div.pdp-bottom-infos__title span'))
.filter(function(span) { return span.textContent == 'Composition'; })
.map(function(span) { return span.closest('div.pdp-bottom-infos__container').querySelector('div.pdp-bottom-infos__content'); })
ingredients.forEach(Allergies.process);
})();