Recreating a Chrome Extension for Pinboard.in Using AI Assistants

Recently, one of my most essential Chrome extensions was automatically disabled after an update. Google Chrome has migrated to Manifest V3 for extensions, causing older, unmaintained extensions to stop working. While I’ve dabbled with extension development in the past, I wasn’t familiar with the new manifest format. This presented a perfect opportunity to test the capabilities of AI assistants like ChatGPT and Claude.

The Problem

The extension in question was simple but critical to my workflow: it allowed me to right-click and post the current page or selection directly to Pinboard.in, my bookmarking service of choice. Pinboard offers a straightforward API for adding links – you simply use the pinboard.in/add URL and pass parameters for the title, link, and description. The service then displays a page where you can adjust these values or add tags before saving.

My initial approach was to ask ChatGPT to convert the old extension to the newer manifest format. This failed completely. Since I couldn’t verify the license of the original extension (the creator’s personal website is offline – I hope they’re okay!), I decided to build a new extension from scratch.

Building a new Plugin from Scratch with AI

I started by explaining my goal to ChatGPT and requesting a Manifest V3 template. This generated the foundational file I used moving forward. I think templating is a really good use case for AI assistants to make. But from there, things went a little awry.

For example, a seemingly simple request like:

"When I right click and select my 'post to pinboard' entry, I want a popup to appear with the pinboard.in/add page"

led to several iterations because my language wasn’t as precise as it should have been. First, ChatGPT created a Chrome popup using chrome.action.openPopup() which is technically correct based on my prompt, but not what I needed.  Once I closed the Chrome popup, then a blank pinboard.in/add page opened in the browser window.  The Title and Link info I entered into the popup did not pass to the pinboard window either. Obviously I was going to have to assume less of the AI when writing my prompts.

After clarification, the new code opened the pinboard.in/add page in a new tab which was closer, but still not ideal. I gave it one more try, clarifying I wanted a new window. Finally, it created a separate popup window, but it wouldn’t automatically close after submission

This inability to autoclose the window was tricky for ChatGPT. Once the user clicks the “Add Bookmark” button, the popup window just went completely white, but would not close, regardless of the command I tried in the listener callback function.  This was frustrating because every time I asked for new code, ChatGPT would reply as if it had made some change, but you produce identical code. The responses were something like

You’re right, I added a window.close() call in the function to make the window close when the “Add Bookmark” button is clicked.

After multiple attempts with ChatGPT producing identical code despite my clarifications, I switched to Claude to see if it could help solve the popup closing issue. I pasted in my code and asked it for help closing the pop up window. Initially, Claude produced similar results, but after some persistence, it understood what I was trying to accomplish.  In it’s final response, it mentioned making the popup window a “true popup” which is the solution I was looking for from the beginning.

With the “post page to Pinboard” feature working properly, I then extended the extension to work with selected text. When text is highlighted on a page, the extension now adds it as the description parameter in the Pinboard form – creating a more versatile bookmarking tool. The last step was making custom icons in inkscape and post it on github.

Installing and Using the Final Product

  1. Click here to see the complete, working extension is available on GitHub.
  2. To test this plugin, simply download the code as a zip file to you PC.
  3. Unzip this folder my right-clicking it and selecting “Extract All” if in windows.
  4. Then open chrome://extensions/
  5. In the top right corner, click to activate “Developer mode”
  6. This will show 3 additional button on the top right of the window. Click “Load Unpacked” and select the folder
  7. Then on any webpage, right-click and select “Post page to Pinboard” (Obviously you should have a pinboard.in account for this to work)

This project shows both the potential and limitations of using AI assistants for development tasks. While they excel at generating boilerplate code and understanding common patterns, precise implementation details sometimes require persistence and clear communication. You can spend longer debugging what they give you rather than just writing the code yourself, even if you aren’t familiar with all the details of the language.  By asking the AI tools for a description of how to do atomic tasks, or how a particular function might work if you are unfamiliar, you’ll get farther than just expecting it to produce good ode on its own.

Fix Your Fire TV Showing a Blank Screen After the Logo

If you’ve recently encountered an issue where your Fire TV loads the logo but gets stuck on a blank screen, you’re not alone. I experienced this frustrating problem myself. The app buttons for Netflix, Hulu, and Disney worked fine, but I couldn’t get the home screen to load or access Prime Video properly. Every time I tried using Prime, I got an error message: “Error: 1061.”  I tried a lot of recommendations from users on Amazon’s forums such as unplugging the firestick from both the HDMI and power for 15 minutes, then trying again. I also tried their suggestion of changing the HDMI port, but nothing they suggested worked.

After some poking around, I eventually found a quick and effective fix:

  1. Open the Prime Video app on your Fire TV.
  2. Navigate to the Account section within Prime.
  3. Select Sign in with a different Amazon account to log out of your current account.
  4. Log back in using your Amazon credentials.

That’s it! After logging back in, everything worked perfectly again—the home screen loaded, and Prime Video was back to normal.

If you’re facing a similar issue, give this method a try before diving into more complicated fixes. It worked like a charm for me!

Design Nerding – Product Dissection of a Kid’s Meal toy

A while back, the CG version of the Lion King came out in theaters. As advertisement for the release Kid’s meals at McDonalds came with themed toys. One was a talking toy. I’ve long been fascinated by toys like this and took apart tons of them as a kid. They are great case studies for DFM (Design for Manufacture).  I wanted to see how they are making them nowadays.

As typical for McDonald’s, you need the tri-bit (or similar sized flat-head and some patience) to take this toy apart.

Once apart, I was amazed at how simple it was.  In the past, I recall a small PCB with a potted silicon die on the board (black blob tech). I was surprised to find that now they no longer have a PCB at all. Now they just have a 4-terminal IC in a custom package. The pins are Vcc, Gnd, and the 2 speaker outputs. Very minimal costs here.

One of the best parts of these kinds of cheap toys are the switches. It is much cheaper to make the switch yourself versus buy a pre-made switch. This one is an elegant design for sure. Th Gnd side of the chip attaches to a cheap stamped metal spring that is bent along two different axes. The long arm of the metal spring fits into a slot on the switch. The switch itself is molded such that it has a compliant spring that helps it “click” into one of two positions moulded on the base of the toy. (Second pic below makes this more obvious, look at the bump on the right side of the switch and the two indexed locations on the right side of the hole in the plastic base).

   

 

Overall the design is about as cheap as you can get for a talking toy while still being well-engineered and not feeling “cheap”. McDonalds typically has some really great engineering in the toys (if you’d believe it) when compared to some other fast food places. For example, the reinforcements in the base of this toy gives an experience that you wouldn’t know the switch was just an extra cobbled together bit of plastic.  The toys are always solid-feeling (not flimsy when you apply force when actuating the switch for instance) and I find it rare to see sunken areas on the outside of the piece opposite of the reinforcement ribs in the plastic. McDonalds only works with a few suppliers for their toys and rigorously check them for safety (after being sued in the 80s for toys being choking hazards, hence the “for ages 3+” warnings on all toys nowadays). Check out this article on one of the companies and see the journey of a toy from concept to reality.

McDonald’s has decided to stop making plastic toys by 2025 globally. I’m sure there are billions of these types of toy in consignment stores, garages, landfills, and buried in back yards across the world if you want to get ahold of some to take apart.

Keep your eyes peeled for great design!

Transfer Files From Phone to PC Easily

I have a Pixel phone that for some reason always disconnects when I try to transfer files over USB to my laptop. it is almost full of pics and videos since I can’t really transfer them off. I finally filled the phone up and had to make space, so I figured out the method I’m going to use from now on to transfer files on and off my phone.

I set my phone up to be a simple little WebDAV server. This allows me to very easily map it as a network drive in windows and transfer files at will.

I downloaded HTTP File Server (+WebDAV ) on my phone. Then I opened it and clicked the “Start button to start the server. Obviously you have to give this app file permissions for it to work.

Then on my PC, I mapped the drive by right-clicking the “This PC” and selected “Map Network Drive:

 

Then type in the address from the HTTP Server app.

Once this is done you can access the file from the phone via whatever drive letter you selected when you mapped it. In the above image the drive is the Y:/

 

Using MPlabX to Program Arduino Boards in Straight C/C++

I wanted to use MplabX to replace the graphical front-end of the Arduino app and write my own bare metal C/C++ code, but use the arduino’s built-in USB programming function. The method below can be done in multiple different IDEs, but I show how to set up MplabX. It is important to note that this method expects the Arduino’s bootloader to be stay on the board.

1. Setting up the Path to the Arduino IDE’s Compiler:

These are different for every computer so you have to find it yourself. To do this, open the Arduino IDE , go to File–>Preferences and click “Show Verbose Output” for both Compile and Download.

Next, plug in a board and send an example project to your Arduino (such as Blink.ino). The command line will spill over with commands.

Scroll to the top of the command window in the ArduinoIDE and look for the line after it says “Compiling Sketch”:

Copy this entire line and paste it to a text file so we can edit it. (Double-click this line to highlight it to copy). Here’s mine:

"C:\\Users\\adamp\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\adamp\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\adamp\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "C:\\Users\\adamp\\AppData\\Local\\Temp\\arduino_build_752190\\sketch\\Blink.ino.cpp" -o "C:\\Users\\adamp\\AppData\\Local\\Temp\\arduino_build_752190\\sketch\\Blink.ino.cpp.o"

 

The highlighted portion above is the file path to the C++ compiler Arduino uses. If we want to write our own bare-bones C or C++ code for the arduino, this is all we need.  Open MPlabX and select “Tools–>Preferences.  In the popup, select the “Embedded” tab.  On the left side, click the Add… button to add a new toolchain. A new popup will appear where you can paste the “Base Directory”. Paste in the highlighted part of your path only up to but NOT including the “avr-g++” part.  This will allow MPlabx to use the AVR-G++ compiler for Atmel chips.

2. Creating a MplabX project:

In MpLabx, start a new standalone project. I’m using an Arduino nano so I will choose the chip “Atmega328P” I recommend you select “Simulator” for the “Tool” entry here as it can be really handy for debugging code.

Then select the new entry “AVR-GCC” for the toolchain.

3. Set up the Programming Tool in MPlabX:

Now to take advantage of the built-in USB programming of an arduino board we need to set up the correct commands. In the Arduino IDE scroll down in the command window and find the last line of white text before the red text begins. The red text is the output from the programmer app (called avrdude.exe).  The line just before this is the command that calls avrdude with the appropriate settings.

 

C:\Users\adamp\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\adamp\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM7 -b115200 -D -Uflash:w:C:\Users\adamp\AppData\Local\Temp\arduino_build_752190/Blink.ino.hex:i

Scroll to the rightmost of the command below to see the highlighted text in the line above. This is the path to the actual hex file the programmer is sending. This changes based on where you name the MPlabx project. You need to change this file path to the following to work with any MPlabX project:

-Uflash:w:${ImagePath}

Once you make this change, simply copy this entire command and paste it into the MplabX project properties.

In Mplabx, right-click the project you want to work on, select Properties, then select “Building” from the left sidebar in the popup window. Make sure to click “Execute this line after build” and paste the entire command from above in the blank.

***BIG NOTE: If you change the port number of the board you are programming (plugging in a different board, or using this same project on a different computer) you MUST change the COM port in this option in the project or it will fail to program and give a cryptic error.

4. Testing with a Blink project:

If you have set everything up correctly, then you can right-click your project and select New–>main.c

Replace the code in this file with the following:

#define F_CPU 16000000UL //You must define the clock frequency before you can use the delay function. This should match the crystal on your board.

#include <stdio.h>
#include <stdlib.h>
#include <util/delay.h> //must use this to use the _delay_ms() function
#include <avr/io.h> //Must use this to access port and pin numbers on our chip

/*
*
*/
int main(int argc, char** argv) {

       //this is where your setup() function goes
       DDRB |= (1 << PORTB5); //Make Arduino Pin13 (AVR PortD Pin5)) and output pin

      while (1) {//this is your "loop" function
           PORTB ^= (1 << PORTB5); //Toggle the value of this pin using an XOR function with itself
          _delay_ms(100); //Change this number to change the LED flashing frequency to know if it is working or not.
        }//end while 1

       return (EXIT_SUCCESS);
}//end main

Then click the build icon and it should compile, then you should see the familiar text from the Arduino IDE. The Avrdude programming information is the red text when you turn on Verbose mode.

Troubleshooting:

If you don’t see this text, a few things might be the cause:

  1. You forgot to click the “Execute after build” checkbox in the build properties
  2. You have the wrong COM port or U:flash setting in the line you want it to execute after building.
  3. Make sure you set your project up with the correct chip and correct toolchain (AVR-GCC)
  4. You have a compilation errors. This can be hard to see, but you can make it easier

If your Arduino isn’t doing what you want it to, then you likely need to debug your code. There’s a LOT to be said with this. The easiest method is to set up a UART library so you can print text out the serial port to your computer. Search github and AVR freaks for examples you can import.

Another method is to use the Simulator in MPlabx to see what bits are being set/changed in the memory location of the Atmega chip.

A third option allows you to run the code line by line on the actual chip. This would require a proper programmer (not just the arduino’s built-in USB programming).  Here’s an example of how to set that up.

Now you can learn to write your own libraries to better understand the magic of the Arduino project. Learn some of the tricks that are used to simplify the interface for programming on this site.