The core functionality of my project is to add a feature to the blocker example extension which allows the user to change the color of each block. Here is a link to the GitHub repository where the code for my extension is hosted: https://github.com/yumingt/bookmarker-extension. To run the code, simply clone the repository, type "chrome://extensions/" into your Chrome browser, click "Load unpacked", and select the folder of the cloned repository. From there, the extension should be accessible through the puzzle icon in the top right of the browser.
Here is a gif of my extension in action:
Here are the steps that outline my process for this project:
An issue that I encountered was a syntax error involving an anonymous function. I created an anonymous function which changes the color of a block every time the "change color" button is clicked, but I encountered an error where the function was being called every time I created a block which resulted in every block defaulting to a black background and the "change color" button was also not working.
I resolved this problem by using print statements and the console in my browser's developer tools to figure out if my "change color" button did anything when I clicked it. Although I did not get any errors, the button would not print anything and the anonymous function was not waiting to run.
After going through my code line by line, I had a friend try to help me debug my code. Finally, we noticed that the parentheses attached to the anonymous function were in the wrong place which was causing the function to run prematurely. Fixing this syntax error by moving the parentheses was what ended up solving my problem.
I would like to thank the GOAT Anderson J Shaw for helping me debug my code. You a real one