├── screenshot.png ├── icons ├── icon16.png ├── icon48.png └── icon128.png ├── content.js ├── manifest.json ├── README.md ├── Greta-Van-10bis.user.js └── LICENSE /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dewbjorn/Greta-Van-10bis/HEAD/screenshot.png -------------------------------------------------------------------------------- /icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dewbjorn/Greta-Van-10bis/HEAD/icons/icon16.png -------------------------------------------------------------------------------- /icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dewbjorn/Greta-Van-10bis/HEAD/icons/icon48.png -------------------------------------------------------------------------------- /icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dewbjorn/Greta-Van-10bis/HEAD/icons/icon128.png -------------------------------------------------------------------------------- /content.js: -------------------------------------------------------------------------------- 1 | const modalsElement = document.querySelector('#modals'); 2 | 3 | const config = { childList: true, subtree: true }; 4 | 5 | const callback = mutationsList => { 6 | for (let mutation of mutationsList) { 7 | const cutleryCheckbox = mutation.target.querySelector('#dont_want_cutlery'); 8 | 9 | if (cutleryCheckbox && !cutleryCheckbox.checked) { 10 | cutleryCheckbox.click(); 11 | } 12 | } 13 | } 14 | 15 | const observer = new MutationObserver(callback); 16 | 17 | observer.observe(modalsElement, config); -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Greta Van 10bis", 3 | "version": "1.1.1", 4 | "manifest_version": 2, 5 | "description": "Disable one time use Plastic cutlery on 10bis", 6 | "icons": { 7 | "16": "icons/icon16.png", 8 | "48": "icons/icon48.png", 9 | "128": "icons/icon128.png" 10 | }, 11 | "browser_action": { 12 | "default_icon": "icons/icon16.png", 13 | "default_title": "Save the planet!" 14 | }, 15 | "permissions": [ 16 | "*://*.10bis.co.il/*", 17 | "*://10bis.co.il/*" 18 | ], 19 | "content_scripts": [ 20 | { 21 | "matches": [ 22 | "*://*.10bis.co.il/*", 23 | "*://10bis.co.il/*" 24 | ], 25 | "js": [ 26 | "content.js" 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Greta Van 10bis 2 | A Chrome & Firefox extension that automatically opts-out from ordering Plastic cutlery on 10bis.co.il. 3 | 4 | Extension URLs: 5 | [Google Chrome](https://chrome.google.com/webstore/detail/greta-van-10bis/feomodgjijapbcblcgdjkjjkgjplmhpa) 6 | | 7 | [Fireox](https://addons.mozilla.org/en-US/firefox/addon/greta-van-10bis) 8 | | 9 | [Greasemonkey Userscript](https://github.com/tkore/Greta-Van-10bis/raw/master/Greta-Van-10bis.user.js) 10 | 11 | 12 | ## What's with the name? 13 | [Greta Thunberg](https://en.wikipedia.org/wiki/Greta_Thunberg) is a Swedish environmental activist on climate change whose campaigning has gained international recognition. 14 | 15 | That, along with the fact that [Greta Van Fleet](https://en.wikipedia.org/wiki/Greta_Van_Fleet) is an awesome band heavily influenced by Led Zeppelin which you should definitely check out if you're a rock fan - should give you an idea about why I chose this peculiar name. :) 16 | 17 |
18 | 19 |

20 | 21 |

22 | -------------------------------------------------------------------------------- /Greta-Van-10bis.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Greta Van 10bis 3 | // @version 1.1.0 4 | // @description Automatically opt-out from ordering Plastic cutlery on 10bis.co.il 5 | // @author Tal Koren (https://github.com/tkore) 6 | // @match http*://*.10bis.co.il/* 7 | // @match http*://10bis.co.il/* 8 | // @grant none 9 | // @updateURL https://github.com/tkore/Greta-Van-10bis/raw/master/Greta-Van-10bis.user.js 10 | // ==/UserScript== 11 | 12 | (function() { 13 | const modalsElement = document.querySelector('#modals'); 14 | 15 | const config = { childList: true, subtree: true }; 16 | 17 | const callback = mutationsList => { 18 | for (let mutation of mutationsList) { 19 | const cutleryCheckbox = mutation.target.querySelector('#dont_want_cutlery'); 20 | 21 | if (cutleryCheckbox && !cutleryCheckbox.checked) { 22 | cutleryCheckbox.click(); 23 | } 24 | } 25 | } 26 | 27 | const observer = new MutationObserver(callback); 28 | 29 | observer.observe(modalsElement, config); 30 | })(); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2019 Tal Koren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | --------------------------------------------------------------------------------