├── README.md ├── img ├── icon128.png ├── icon16.png ├── icon36.png ├── icon48.png ├── preview.jpg └── scroll.sketch ├── manifest.json ├── no-scroll-jacking.zip └── start.js /README.md: -------------------------------------------------------------------------------- 1 | # No more scroll jacking 2 | 3 | Prevents scroll jacking whilst a meta key is held. 4 | 5 | 6 | 7 | > Why isn't this turned on by default? 8 | 9 | Perhaps I'll get around to making this an option, but I know that it breaks some sites, so it's simpler to opt-in to the anti-scroll jacking. I've already gotten into the habit of holding shift when scrolling these nasties already! 10 | 11 | 12 | 13 | ## Icon 14 | 15 | Icons a derivative of made by [Pixelmeetup](https://www.flaticon.com/authors/pixelmeetup) from [www.flaticon.com](https://www.flaticon.com/ "Flaticon") is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/ "Creative Commons BY 3.0") 16 | -------------------------------------------------------------------------------- /img/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/icon128.png -------------------------------------------------------------------------------- /img/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/icon16.png -------------------------------------------------------------------------------- /img/icon36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/icon36.png -------------------------------------------------------------------------------- /img/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/icon48.png -------------------------------------------------------------------------------- /img/preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/preview.jpg -------------------------------------------------------------------------------- /img/scroll.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/img/scroll.sketch -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "No more scroll jacking", 4 | "description": "This extension prevents scroll jacking whilst holding a meta key", 5 | "version": "1.0", 6 | "content_scripts": [ 7 | { 8 | "matches": ["http://*/*", "https://*/*"], 9 | "js": ["start.js"], 10 | "run_at": "document_start" 11 | } 12 | ], 13 | "permissions": ["activeTab"], 14 | "author": "Remy Sharp", 15 | "icons": { 16 | "128": "img/icon128.png", 17 | "16": "img/icon16.png", 18 | "48": "img/icon48.png" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /no-scroll-jacking.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remy/no-more-scroll-jacking/6fcbe4cb3160016d973ec360a1e2537221b000fb/no-scroll-jacking.zip -------------------------------------------------------------------------------- /start.js: -------------------------------------------------------------------------------- 1 | (() => { 2 | let prevent = false; 3 | const on = (type, handler, capture = false) => 4 | self.addEventListener(type, handler, capture); 5 | 6 | const stop = e => { 7 | try { 8 | if (prevent) { 9 | e.stopImmediatePropagation(); 10 | if (e.cancelable) e.preventDefault(); 11 | } 12 | } catch (e) {} 13 | }; 14 | 15 | on('keydown', e => { 16 | prevent = e.shiftKey || e.altKey || e.metaKey || e.ctrlKey; 17 | }); 18 | on('keyup', e => (prevent = false)); 19 | on('mousewheel', stop, true); 20 | on('scroll', stop, true); 21 | on('wheel', stop, true); 22 | })(); 23 | --------------------------------------------------------------------------------