├── LICENSE ├── README ├── img ├── 128n.png ├── 16n.png ├── 32n.png ├── 48n.png ├── cursor.png └── forkme.png ├── manifest.json ├── pages ├── background.js ├── options.html └── options.js └── src ├── middlemouse.js └── sscr.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | ---- 3 | 4 | Copyright (c) 2010-2018 Balazs Galambosi 5 | 6 | The only restriction is to not publish any extension for browsers or 7 | native application without getting a written permission first. Otherwise: 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | A Google Chrome extension for smooth scrolling with the mouse wheel and keyboard buttons. 2 | 3 | Also available as a Mac app 4 | http://www.smoothscroll.net/mac/ 5 | 6 | Embedding it into your website 7 | https://github.com/gblazex/smoothscroll-for-websites 8 | 9 | Chrome extension 10 | https://chrome.google.com/webstore/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj 11 | 12 | Opera extension 13 | https://addons.opera.com/extensions/details/smoothscroll-3/ 14 | 15 | Features 16 | - Picasa-like smooth scrolling 17 | - Mouse wheel, middle mouse and keyboard support 18 | - Arrow keys, PgUp/PgDown, Spacebar, Home/End 19 | - Customizable step sizes, frames per second and more... 20 | - Works with embedded content (PDF, flash) 21 | - Full touchpad support 22 | - Excluded pages list 23 | 24 | People involved 25 | - Balazs Galambosi (maintainer) 26 | - Michael Herf (pulse algorithm) 27 | -------------------------------------------------------------------------------- /img/128n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/128n.png -------------------------------------------------------------------------------- /img/16n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/16n.png -------------------------------------------------------------------------------- /img/32n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/32n.png -------------------------------------------------------------------------------- /img/48n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/48n.png -------------------------------------------------------------------------------- /img/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/cursor.png -------------------------------------------------------------------------------- /img/forkme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gblazex/smoothscroll/5098123b2bcb96e5755aee6c9a32489ab4f813df/img/forkme.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "background": { 3 | "scripts": [ "pages/background.js" ], 4 | "persistent": false 5 | }, 6 | "content_scripts": [ { 7 | "all_frames": true, 8 | "js": [ "src/sscr.js", "src/middlemouse.js" ], 9 | "matches": [ "http://*/*", "https://*/*", "ftp://*/*" ], 10 | "exclude_globs": ["*.pdf*"], 11 | "run_at": "document_start" 12 | } ], 13 | "description": "Scroll smoothly on all websites with your mouse and keyboard.", 14 | "icons": { 15 | "128": "img/128n.png", 16 | "16": "img/16n.png", 17 | "32": "img/32n.png", 18 | "48": "img/48n.png" 19 | }, 20 | "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD1YCUodXSIZuDNa4PJGDCzSWnJAsPymJLQNj+fbxNHbE8BJ4x062dCB0rg0ovXXjNjGJW5FUX+aIEdhh1oNpouWkfu0GP6D6VXCrArXS1hKa7mV8jrBSuMLQo/aU3X7iieqkDzeSFRwUaAEp54C62J22sJ06EHI1QMLuCJ6C9lVQIDAQAB", 21 | "name": "SmoothScroll", 22 | "options_page": "pages/options.html", 23 | "version": "1.5.10", 24 | "manifest_version": 2, 25 | "permissions": ["storage", "http://*/*", "https://*/*"], 26 | "web_accessible_resources": [ "img/cursor.png" ] 27 | } 28 | -------------------------------------------------------------------------------- /pages/background.js: -------------------------------------------------------------------------------- 1 | 2 | var defaultOptions = { 3 | 4 | // Plugin 5 | middleMouse : true, 6 | 7 | // Scrolling Core 8 | framerate : 150, // [Hz] 9 | animationTime : 400, // [px] 10 | stepSize : 120, // [px] 11 | 12 | // Pulse (less tweakable) 13 | // ratio of "tail" to "acceleration" 14 | pulseAlgorithm : true, 15 | pulseScale : 4, 16 | pulseNormalize : 1, 17 | 18 | // Acceleration 19 | accelerationDelta : 20, // 20 20 | accelerationMax : 1, // 1 21 | 22 | // Keyboard Settings 23 | keyboardSupport : true, // option 24 | arrowScroll : 50, // [px] 25 | 26 | // Other 27 | touchpadSupport : true, 28 | fixedBackground : true, 29 | excluded : "example.com, another.example.com" 30 | } 31 | 32 | 33 | // Fired when the extension is first installed, 34 | // when the extension is updated to a new version, 35 | // and when Chrome is updated to a new version. 36 | chrome.runtime.onInstalled.addListener(init); 37 | 38 | function init(details) { 39 | if (details.reason == "install") { 40 | chrome.storage.sync.set(defaultOptions); 41 | var optionsPage = chrome.runtime.getURL("pages/options.html"); 42 | chrome.tabs.create({ url: optionsPage }); 43 | chrome.tabs.query({}, function (tabs) { 44 | tabs.forEach(addSmoothScrollToTab); 45 | }); 46 | } 47 | } 48 | 49 | function addSmoothScrollToTab(tab) { 50 | chrome.tabs.executeScript(tab.id, { 51 | file: "src/sscr.js", 52 | allFrames: true 53 | }); 54 | chrome.tabs.executeScript(tab.id, { 55 | file: "src/middlemouse.js", 56 | allFrames: true 57 | }); 58 | } 59 | -------------------------------------------------------------------------------- /pages/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | SmoothScroll Options 4 | 5 | 184 | 185 | 186 | 187 | 188 | 189 | 190 |
191 | SmoothScroll 192 |
193 |
194 | 195 | 196 | Fork me on GitHub 197 | 198 |
199 | 200 |

Scroll Settings

201 | 202 | 203 |
204 |   Load profile: 205 | 206 | 207 | 208 | 209 | 210 |
211 | 212 |
213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 |
Default value: 100(how much)
Default value: 400(how quick)
Default value: 3(how swift)
Default value: 50(time between scroll events)
Default value: 4(ratio of "tail" to "acceleration")
Default value: 50
251 |
252 | 253 |

Features

254 | 255 |

256 | 257 |

258 | 259 |

260 | 261 |

262 | 263 |

264 | 265 | 266 | 267 | 274 |
275 | 276 |
277 | 278 |

279 | 280 | 281 |

282 | 283 | 284 | 285 |
If you love this extension please consider 286 | writing a great review 287 |
288 | 289 | 295 | 296 | 317 | 318 |
319 | 320 | 321 | 322 | 323 |





324 | 325 |
326 |
Settings saved
327 |
You can now test the new scroll settings!
328 |
329 | 330 |
331 | 332 |

Test your settings!

333 | 334 |
335 |

By scrolling on this long page.

336 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum non orci ipsum, eu laoreet nisl. Suspendisse ut dictum neque. Pellentesque nulla ipsum, posuere ut mattis vel, dapibus fringilla arcu. Donec fermentum purus in risus convallis semper. Nullam tempor urna eu libero vulputate vitae pulvinar enim accumsan. Donec vitae leo a enim faucibus consectetur. Nullam lectus justo, eleifend quis condimentum ut, pharetra et risus. Ut luctus molestie nibh sit amet vestibulum. Vestibulum tempor luctus scelerisque. Duis posuere elementum mollis. Cras sit amet varius massa. Nulla condimentum feugiat aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean id ante et diam lacinia convallis vel eu magna.

337 | 338 |

In congue, risus sed commodo molestie, tortor sem dictum neque, in viverra sapien arcu vulputate velit. Pellentesque nec dignissim neque. Proin non felis quis lectus fermentum lobortis ut nec purus. Nam quam turpis, sodales in pellentesque vel, tempor gravida lacus. Pellentesque euismod aliquet pulvinar. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed tempus velit in lacus tristique facilisis. Mauris commodo, nunc et tempor pharetra, lectus dui posuere odio, eu auctor lorem augue non neque. Aenean auctor velit ac erat lobortis iaculis. Nullam in nibh et sem porttitor malesuada non non urna. Nulla lacus est, aliquet vel egestas a, accumsan a ante. Sed semper molestie dictum. Morbi at quam non enim porttitor varius. Vivamus ut metus et enim egestas ornare malesuada at augue.

339 | 340 |

Morbi laoreet velit sit amet metus tincidunt hendrerit. Aliquam augue ante, venenatis a rutrum sit amet, tristique non urna. Suspendisse et euismod nunc. Donec tempus luctus convallis. Proin blandit justo in nulla volutpat imperdiet. Integer dapibus lectus vitae libero hendrerit commodo. Praesent felis metus, pretium id tempus sed, porttitor ut justo. Praesent dapibus massa a erat congue malesuada. Fusce at erat in augue lobortis ultrices. Fusce vitae nunc sed arcu viverra convallis. Etiam nec magna turpis, id iaculis dui. Etiam at interdum est. Ut quis eros justo, vel consequat dolor. Proin pulvinar tristique congue. Mauris consectetur aliquam ipsum lobortis tempor. In non ligula orci, a commodo turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer non tempus lectus. Praesent tristique ante a purus lobortis viverra.

341 | 342 |

Curabitur eget leo velit, ac sagittis arcu. Mauris pulvinar orci et libero ultricies non iaculis velit gravida. Nulla facilisi. Pellentesque vel tellus nisl, et eleifend turpis. Vestibulum accumsan tincidunt tellus ac posuere. Nunc et orci metus. Cras quis lacus at tortor semper sollicitudin. Sed mi velit, semper et eleifend eget, faucibus mattis velit. Quisque interdum, risus et vulputate cursus, mauris elit fermentum nunc, in imperdiet ipsum odio sed magna. Vivamus porttitor ornare lacus in congue. Morbi et justo nulla, non tincidunt eros. Nulla scelerisque, tortor eget pulvinar volutpat, ante justo dapibus arcu, eu lacinia quam ante ut libero. Integer porta libero eu est scelerisque malesuada. Sed risus diam, pellentesque eu euismod sit amet, rhoncus quis velit. Aliquam et vehicula odio. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nec magna nec odio venenatis sollicitudin non id massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut in eleifend mauris.

343 | 344 |

Sed ac scelerisque nisl. Vivamus ac diam et nibh pulvinar gravida vitae a magna. Fusce ipsum ligula, suscipit sit amet ullamcorper a, fringilla sed neque. Curabitur ipsum dolor, consectetur condimentum luctus nec, molestie eu nulla. Curabitur eros nunc, varius at vestibulum sed, tincidunt aliquam risus. Aenean ultricies iaculis augue. Sed tempor scelerisque velit, et dignissim erat hendrerit gravida. Mauris consectetur porta lacus vel posuere. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut diam diam, tempus mattis interdum nec, tincidunt in ante. Pellentesque lacus ipsum, eleifend non imperdiet id, dapibus vel metus. Proin egestas sagittis urna facilisis congue. Fusce nec dapibus nibh.

345 |
346 |
347 | 348 | 349 | 350 | 351 | -------------------------------------------------------------------------------- /pages/options.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Options page logic. 4 | */ 5 | (function(window, undefined){ 6 | 7 | /** 8 | * List of available options 9 | */ 10 | var optionsList = [ 11 | 'animationTime', 12 | 'stepSize', 13 | 'arrowScroll', 14 | 'middleMouse', 15 | 'accelerationMax', 16 | 'accelerationDelta', 17 | 'pulseAlgorithm', 18 | 'pulseScale', 19 | 'keyboardSupport', 20 | 'touchpadSupport', 21 | 'excluded', 22 | 'fixedBackground' 23 | ]; 24 | 25 | var options = {}; 26 | 27 | function byId(id) { return document.getElementById(id); } 28 | function byClass(cname) { return document.getElementsByClassName(cname); } 29 | function byTag(tag,base) { return (base||document).getElementsByTagName(tag||'*'); } 30 | 31 | function isNodeName(el, tag) { 32 | return el.nodeName.toLowerCase() === tag.toLowerCase(); 33 | } 34 | 35 | function show(elem, newop) { 36 | elem.style.display = "block"; 37 | elem.style.webkitTransition = "opacity 0.2s ease-in-out"; 38 | setTimeout(function(){ 39 | elem.style.opacity = (newop || 1); 40 | }, 0); 41 | } 42 | 43 | function hide(elem, newop) { 44 | elem.style.webkitTransition = "opacity 1s ease-in-out"; 45 | elem.style.opacity = (newop || 0); 46 | setTimeout(function(){ 47 | elem.style.display = "none"; 48 | }, 1000); 49 | } 50 | 51 | function isCheckbox(key) { 52 | var re = /^(?:keyboardSupport|touchpadSupport|middleMouse|pulseAlgorithm|fixedBackground)$/; 53 | return re.test(key); 54 | } 55 | 56 | function init() { 57 | chrome.storage.sync.get(optionsList, initWithOptions); 58 | } 59 | 60 | /** 61 | * Fills up the form with the saved values from local storage. 62 | */ 63 | function initWithOptions(optionsSynced) { 64 | 65 | options = optionsSynced; 66 | 67 | // settings were updated -> show dialog 68 | if (localStorage.saved == 'true') { 69 | var dialog = byClass('dialog')[0]; 70 | show(dialog, 0.9); 71 | setTimeout(function () { 72 | hide(dialog); 73 | }, 3000); 74 | } 75 | 76 | // updated complete 77 | localStorage.saved = 'false'; 78 | 79 | // fill the form fields from storage 80 | for (var key in options) { 81 | if (isCheckbox(key)) { 82 | byId(key).checked = options[key]; 83 | } else if (options[key]) { 84 | byId(key).value = options[key]; 85 | } 86 | } 87 | } 88 | 89 | /** 90 | * Saves the values from the form to local storage. 91 | */ 92 | function save() { 93 | 94 | var i, key, opt, elem, error, options = {}; 95 | 96 | // save options to the local storage 97 | optionsList.forEach(function(key, i) { 98 | // and