The making of a chrome extension ツ

OVERVIEW

In this project, I created a Chrome extension called the "Cookie Counter". This extension functions to increase awareness of a website's cookies - through replacing the images on a website with a cookie gif (based on how many cookies there are). The extension also has an option to delete the cookies on the current page.



DEVELOPMENT PROCESS

These are the main steps I took in approaching this project.


  • Cloning examples from the instructor and reading/analyzing them to learn how javascript worked
  • Found Google's cookie API, and narrowed down my project direction by using Google's cookie extension example as a starting point
  • Laying out my files and customizing the CSS
  • Created a line on my extension to display the current number of cookies
  • Created a "enable cookie" checkbox
  • Connecting javascript to content script
  • (2 mid-process photos shown below)



  • ISSUE DEEP DIVE

    I ran into several issues in this project. One of the most notable issues was displaying a line of text that updated the number of current cookies on a site. It was a logic issue where at first, I was unable to get the cookie number variable to be connected with my html's inline container.


    I approached this problem with several steps, including:

  • Using console.log() to report back to see where in my code was coming up null
  • Started by referencing the deleteCookies function that was originally in the template code
  • My code was not working at this point, so I tried adding an EventListener that called a function when the DOM was fully loaded and parsed
  • Lastly, I needed the extension to update this number whenever a user deleted the site's cookies


  • Final extension here or shown below (may take a while to load):



    IDEAS AND FUTURE WORK

    Here are some ideas for improving on this extension:


  • Having the current number of cookies on the page float around on the screen
  • Be able to update the number of cookies even after deleting them (as they come up)
  • Have extra resource links about cookies
  • Having original images come back up when the cookies are disabled
  • Image of cookies update once they are deleted


  • KUDOS

    I got lots of support and resources during this project, including:


  • Allison Parrish's Creative Computing
  • p5.play demos
  • Sound tutorial by The Coding Train
  • Big shoutout to my instructor Hannah for helping me work through my coding roadblocks