Update for Courses U new website

master
Guillaume Dott 2019-02-13 14:27:38 +01:00
parent 5f7795d971
commit 3fc858e957
1 changed files with 2 additions and 9 deletions

View File

@ -4,17 +4,10 @@
// @description Affiche une alerte lorsqu'un produit contient un des ingrédients interdits
// @include https://www.coursesu.com/*
// @include http://www.coursesu.com/*
// @version 2.2
// @version 2.3
// @grant none
// @require https://code.amnesix.eu/guillaume/allergies-userscripts/raw/branch/master/Allergies-1.1.js
// ==/UserScript==
(function() {
document.querySelectorAll('#listeInfosProduitsZone .infos').forEach(Allergies.process);
var productModalZone = document.getElementById('productModalZone');
var observer = new MutationObserver(function(mutations) {
var composition = mutations[0].addedNodes[0].querySelector('.composition');
Allergies.process(composition);
});
observer.observe(productModalZone, {childList: true});
document.querySelectorAll('div.tab-ingredient p').forEach(Allergies.process);
})();