The initial motivation for creating this extension was to replace the dead ‘Dream After’ extension that I had been using for many years.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
If you are new to Browser extension development, I highly recommend reading the official documentation first.
https://developer.chrome.com/extensions
This is the reference for the available API from Chrome.
https://developer.chrome.com/extensions/api_index
Download the Source Code: Clone the repository to your local machine.
Set Up Environment Variables: Create a .env file in the root directory of the project. Fill in the API keys by registering for the free developer programs on PEXELS and Open Weather.
You can refer to the .env.local.example file for the structure.
Example .env file:
PEXELS_API_KEY=your_pexels_api_key
OPENWEATHERMAP_API_KEY=your_openweathermap_api_key
Configure API Endpoints: The API keys will be automatically picked up from the .env file. Ensure that your wallpaper.js and weather.js files are set up to use these environment variables.
PEXELS: {
url: 'https://api.pexels.com/v1/search?',
name: 'pexels',
key: process.env.PEXELS_API_KEY
}
class Weather {
constructor() {
this.BASE = {
api: "https://api.openweathermap.org/data/2.5/onecall",
key: process.env.OPENWEATHERMAP_API_KEY,
};
}
}
Install Dependencies: Run the following command to install the necessary dependencies:
npm install
To start developing the extension, follow these steps:
npm run start:chrome:dev
npm run start:edge:dev
chrome://extensions.To prepare the extension for production, follow these steps:
npm run build:chrome:prod
npm run build:edge:prod
dist folder and upload it to the related Web Store.Any ideas or development contributions are welcome.