Website Logo SAlon's Portfolio

Chrome Extension Project

By Alon Barak on May 16, 2024
Image post 6

👋 Excited to share my latest small project released on the Chrome Web Store!

Introducing a Chrome extension designed to kickstart your day with fun brain training:

This Chrome extension’s sole purpose is to open your favorite Daily puzzles every morning. Once a day when you first open Chrome, all of your favorite puzzles will be there to start your day just right.

The extension currently includes popular puzzles like Wordle, Worldle, NYT Crossword, and more. Plus, it’s easy to add your own puzzle to be opened.

First Screenshot of the extension Second Screenshot of the extension

Built using the classic HTML, CSS, and JS, with integration of Chrome extensions API and Service workers, this project marks the beginning of an exciting journey into extension development.

Code Snippet

chrome.runtime.onStartup.addListener(() => {
  isNewDay().then(isNew => {
    if (isNew) {
      if (Array.isArray(userPuzzles)) {
        userPuzzles.forEach(puzzle => {
          if (puzzle.enabled) {
            chrome.tabs.create({ url: puzzle.url });
          }
        });
      }

      const today = new Date().toLocaleDateString();
      chrome.storage.local.set({ 'lastCheck': today }, function () {
        console.log('Last check date is set to ' + today);
      });
    }
  });
});