allergies-userscripts/Courses_U_allergies.user.js

21 lines
851 B
JavaScript
Raw Normal View History

2019-02-13 14:20:08 +01:00
// ==UserScript==
// @name Courses U allergies
// @namespace http://amnesix.eu
// @description Affiche une alerte lorsqu'un produit contient un des ingrédients interdits
// @include https://www.coursesu.com/*
// @include http://www.coursesu.com/*
2019-02-13 14:21:32 +01:00
// @version 2.2
2019-02-13 14:20:08 +01:00
// @grant none
2019-02-13 14:21:32 +01:00
// @require https://code.amnesix.eu/guillaume/allergies-userscripts/raw/branch/master/Allergies-1.1.js
2019-02-13 14:20:08 +01:00
// ==/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});
})();