Last active
October 26, 2016 16:51
-
-
Save bigloser/435a367b2f2c0be8bedaa5a89b11598b to your computer and use it in GitHub Desktop.
greasemonkey script to only show veggie options
This file contains hidden or 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
| // ==UserScript== | |
| // @name Eat Club Veggies | |
| // @namespace sshah | |
| // @include https://www.eatclub.com/* | |
| // @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| window.addEventListener('load', function () { | |
| waitForKeyElements('.ec-menu-item', function () { | |
| $('div.ec-menu-item').each(function () { | |
| var imgs = $(this).find('img'); | |
| var foundVeggie = false; | |
| if (imgs.length) { | |
| for (var index = 0; index < imgs.length; ++index) { | |
| var img = imgs[index]; | |
| if (img.src.endsWith('vegan.svg') || img.src.endsWith('vegetarian.svg')) { | |
| foundVeggie = true; | |
| } | |
| } | |
| if (!foundVeggie) { | |
| $(this).remove(); | |
| } | |
| } | |
| }); | |
| }) | |
| }, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment