Open source new tab extension
- Layout/design based on what I liked from the Momentum browser extension
- Date and time with greeting
- Current temp/conditions (from OpenWeatherMap)
- uses location data from network the incoming request is made on (location is sometimes unavailable or inaccurate)
- Random quote (quotes provided by ZenQuotes API)
- Random background image (from Unsplash API)
- Top posts from some useful sites
- React - JavaScript Framework
- Mantine - Component Library for React
- Jotai - State Management Library for React
- Vite - Build Tool
- FontAwesome - Icons
- Axios - HTTP Client
- dayjs - Date Library
- Roboto Slab via Google Fonts - Font
- CloudFlare Pages - Hosting and Serverless Functions for API
Demo available as a progressive web app (PWA):
- Install dependencies
npm install
- Build extension
npm run build:extension
- This will create a
build
folder with the extension files and aclean-start-extension.zip
file (used for submission to Chrome Store)
- This will create a
- Run/develop locally
npm start
NOTE: You will need API keys from OpenWeatherMap and Unsplash to build and run the serverless functions used as API endpoints for this extension. You can get API keys for both services for FREE (links below)
OpenWeatherMap
- Developer page https://openweathermap.org/api
- Sign up for FREE https://home.openweathermap.org/users/sign_up
Unsplash
- Developer page https://unsplash.com/developers
- Sign up for FREE https://unsplash.com/oauth/applications
Once you have the API keys, make sure to set environment variables for each using the following names:
UNSPLASH_ACCESS_KEY
UNSPLASH_SECRET_KEY
OPEN_WEATHERMAP_API_KEY
For local development, create a file in the root directory of this project named .dev.vars
with the same format as a typical .env
file:
UNSPLASH_ACCESS_KEY="xxxxxx"
UNSPLASH_SECRET_KEY="xxxxxx"
OPEN_WEATHERMAP_API_KEY="xxxxxx"
NOTE: for GH Codespaces development, you will need to set the env vars as Actions Secrets in the settings for your forked repo
MIT License
Copyright (c) 2024 Michael Sprague
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.