2.4.1 Release (GITHUB!)
2.4.1 adds neither features nor bug fixes, but instead just prepared the code for release on GitHub. Scroll to Top Button is and has been open source, but now it is officially on GitHub. This is actually the first time using it, so I’ve still got some learning to do, but for anyone who would like to dig around in the code, it’s there.
https://github.com/codysherman/Scroll-to-Top-Button-Extension
Some notable features of STTB in terms of designing a Chrome Extension:
- contentscript.js is the main part of the extension and thus needs to transfer the user’s options.html settings from [LocalStorage], which is blocked in Chrome. So I use background.html as a middle man to pass them to contentscript.js
- The Options page consists of drop down menus that both autosave on change as well as report choice popularity to Google Analytics. User options are restored on load, but are also created to defaults if none exist via background.html
- The extension checks the URL against various Tumblr pages to determine whether or not the button is already built into the page.